Beispiel #1
0
        public byte[] Write()
        {
            MemoryStream       m  = new MemoryStream();
            EndianBinaryWriter er = new EndianBinaryWriter(m, Endianness.LittleEndian);

            Header.NrBlocks = (ushort)(TexPlttSet != null ? 2 : 1);
            Header.Write(er);

            long curpos = er.BaseStream.Position;

            er.BaseStream.Position = 16;
            er.Write((UInt32)curpos);
            er.BaseStream.Position = curpos;

            ModelSet.Write(er);
            if (TexPlttSet != null)
            {
                curpos = er.BaseStream.Position;
                er.BaseStream.Position = 20;
                er.Write((UInt32)curpos);
                er.BaseStream.Position = curpos;

                TexPlttSet.Write(er);
            }
            er.BaseStream.Position = 8;
            er.Write((UInt32)er.BaseStream.Length);
            byte[] b = m.ToArray();
            er.Close();
            return(b);
        }
        public byte[] Write()
        {
            MemoryStream       m  = new MemoryStream();
            EndianBinaryWriter er = new EndianBinaryWriter(m, Endianness.LittleEndian);

            Header.Write(er);

            long curpos = er.BaseStream.Position;

            er.BaseStream.Position = 16;
            er.Write((UInt32)curpos);
            er.BaseStream.Position = curpos;

            TexPlttSet.Write(er);
            er.BaseStream.Position = 8;
            er.Write((UInt32)er.BaseStream.Length);
            byte[] b = m.ToArray();
            er.Close();
            return(b);
        }