Exemplo n.º 1
0
        /// <summary>
        /// Write this LBD file to a binary stream.
        /// </summary>
        /// <param name="bw">The binary stream.</param>
        public void Write(BinaryWriter bw)
        {
            Header.Write(bw);
            for (int y = 0; y < Header.TileHeight; y++)
            {
                for (int x = 0; x < Header.TileWidth; x++)
                {
                    TileLayout[x, y].Write(bw);
                }
            }

            foreach (LBDTile tile in ExtraTiles)
            {
                tile.Write(bw);
            }

            bw.BaseStream.Seek(Header.TilesTMDOffset + Header.AddressOffset, SeekOrigin.Begin);
            Tiles.Write(bw);

            if (Header.HasMML)
            {
                bw.BaseStream.Seek(Header.MMLOffset, SeekOrigin.Begin);
                MML?.Write(bw);
            }
        }
Exemplo n.º 2
0
        /// <summary>
        /// Write this MOM file to a binary stream.
        /// </summary>
        /// <param name="bw">The binary stream.</param>
        public void Write(BinaryWriter bw)
        {
            uint momTop = (uint)bw.BaseStream.Position;

            bw.Write(ID);
            bw.Write(MOMLength);
            bw.Write(TMDOffset);
            MOS.Write(bw);

            bw.BaseStream.Seek(momTop + TMDOffset, SeekOrigin.Begin);
            TMD.Write(bw);
        }