コード例 #1
0
ファイル: ACO.cs プロジェクト: MetLob/tinke
        public override void Read(string fileIn)
        {
            Helper.BinaryReaderBE br = new Helper.BinaryReaderBE(fileIn);
            Color[] pal;

            ushort version = br.ReadUInt16();
            if (version != 0x00)
            {
                System.Windows.Forms.MessageBox.Show("Version not supported. Only 0");
                throw new FormatException("Version not supported. Only 0");
            }
            ushort num_colors = br.ReadUInt16();

            pal = new Color[num_colors];
            for (int i = 0; i < num_colors; i++)
            {
                ushort spec = br.ReadUInt16();
                if (spec != 0x00)
                {
                    System.Windows.Forms.MessageBox.Show("Color spec not supported. Only 0");
                    throw new FormatException("Color spec not supported. Only 0");
                }
                pal[i] = Color.FromArgb(br.ReadUInt16(), br.ReadUInt16(), br.ReadUInt16());
                br.ReadUInt16();    // Always 0x00
            }

            br.Close();
        }
コード例 #2
0
ファイル: ACO.cs プロジェクト: calvarado194/layton-rando
        public override void Read(string fileIn)
        {
            Helper.BinaryReaderBE br = new Helper.BinaryReaderBE(fileIn);
            Color[] pal;

            ushort version = br.ReadUInt16();

            if (version != 0x00)
            {
                System.Windows.Forms.MessageBox.Show("Version not supported. Only 0");
                throw new FormatException("Version not supported. Only 0");
            }
            ushort num_colors = br.ReadUInt16();

            pal = new Color[num_colors];
            for (int i = 0; i < num_colors; i++)
            {
                ushort spec = br.ReadUInt16();
                if (spec != 0x00)
                {
                    System.Windows.Forms.MessageBox.Show("Color spec not supported. Only 0");
                    throw new FormatException("Color spec not supported. Only 0");
                }
                pal[i] = Color.FromArgb(br.ReadUInt16(), br.ReadUInt16(), br.ReadUInt16());
                br.ReadUInt16();    // Always 0x00
            }

            br.Close();
        }