Esempio n. 1
0
        public NCGR(byte[] file)
        {
            EndianBinaryReader er = new EndianBinaryReader((Stream) new MemoryStream(file), Endianness.LittleEndian);
            bool OK;

            this.Header = new FileHeader.HeaderInfo(er, "RGCN", out OK);
            if (!OK)
            {
                // TODO: Message box
                //int num1 = (int) MessageBox.Show("Error 0");
            }
            else
            {
                this.CharacterData = new NCGR.Characterdata(er, out OK);
                if (!OK)
                {
                    // TODO: Message box
                    //int num2 = (int) MessageBox.Show("Error 1");
                }
                else if (this.Header.dataBlocks == (ushort)2)
                {
                    this.CharacterPosInfoBlock = new NCGR.CharacterposInfoBlock(er, out OK);
                    if (!OK)
                    {
                        // TODO: Message box
                        //int num3 = (int) MessageBox.Show("Error 2");
                    }
                }
            }
            er.Close();
        }
Esempio n. 2
0
 public NCGR(byte[] data, int width, int height, Graphic.GXTexFmt fmt)
 {
     this.Header        = new FileHeader.HeaderInfo("RGCN", (ushort)1);
     this.CharacterData = new NCGR.Characterdata(data, width, height, fmt);
 }