Example #1
0
        public void WriteTo(BinaryWriter bw)
        {
            var initOffset = bw.BaseStream.Position;

            bw.BaseStream.Position = initOffset + HeaderInstance.TextureDataOffset;
            var compressedPixels = RawChar.Compress(PixelMap);

            bw.Write(compressedPixels);
            bw.BaseStream.Position = initOffset + HeaderInstance.PaletteDataOffset;
            bw.Write(RawPalette.Compress(Palette1));
            bw.Write(RawPalette.Compress(Palette2));
        }
Example #2
0
            public CHAR(BinaryReader br)
            {
                var initOffset = br.BaseStream.Position;
                var header     = new Header(br);

                TilesPerColumn = header.TilesPerColumn;
                Data           = br.ReadBytes(header.DataLength);
                if (header.BitsPerPixel == BitsPerPixel.FourBitsPerPixel)
                {
                    Data = RawChar.Decompress(Data);
                }
                br.BaseStream.Position = initOffset + header.TotalLength;
            }
Example #3
0
        public TEX0(BinaryReader br)
        {
            var initOffset = br.BaseStream.Position;

            HeaderInstance         = new Header(br);
            br.BaseStream.Position = initOffset + HeaderInstance.TextureDataOffset;
            PixelMap = RawChar.Decompress(br.ReadBytes(HeaderInstance.TextureDataLength));
            br.BaseStream.Position = initOffset + HeaderInstance.PaletteDataOffset;
            var palLen = HeaderInstance.PaletteDataLength / 2;

            Palette1 = RawPalette.Decompress(br.ReadBytes(palLen));
            Palette2 = RawPalette.Decompress(br.ReadBytes(palLen));
        }