Exemple #1
0
            public PLTT(BinaryReader br)
            {
                var initOffset = br.BaseStream.Position;
                var header     = new Header(br);

                br.BaseStream.Position = initOffset + 8 + header.DataOffset;
                Palette = RawPalette.Decompress(br.ReadBytes(header.DataLength));
            }
Exemple #2
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));
        }
Exemple #3
0
        public static STL Load(BinaryReader br)
        {
            var header = new Header(br);
            var stl    = new STL
            {
                Width   = header.Width,
                Height  = header.Height,
                Palette = RawPalette.Decompress(br.ReadBytes(PaletteDataLength)),
                Pixels  = br.ReadBytes(header.Width * header.Height)
            };

            br.Skip(PaddingLength);
            return(stl);
        }
Exemple #4
0
        public static SCBG Load(BinaryReader br)
        {
            var scbg = new SCBG();

            var magicNumber = br.ReadMagicNumber();

            if (magicNumber != MagicNumber)
            {
                throw new InvalidDataException($"Unexpected magic number '{magicNumber}'. (expected: {MagicNumber})");
            }
            scbg.Width  = br.ReadUInt16();
            scbg.Height = br.ReadUInt16();

            scbg.Palette = RawPalette.Decompress(br.ReadBytes(PaletteDataLength));
            scbg.Pixels  = br.ReadBytes(scbg.Width * scbg.Height);

            return(scbg);
        }