public NCLR(byte[] file) { EndianBinaryReader er = new EndianBinaryReader((Stream) new MemoryStream(file), Endianness.LittleEndian); bool OK; this.Header = new FileHeader.HeaderInfo(er, "RLCN", out OK); if (!OK) { er.BaseStream.Position = 0L; this.Header = new FileHeader.HeaderInfo(er, "RPCN", out OK); } if (!OK) { // TODO: Message box //int num1 = (int) MessageBox.Show("Error 0"); } else { this.PaletteData = new NCLR.Palettedata(er, out OK); if (!OK) { // TODO: Message box //int num2 = (int) MessageBox.Show("Error 1"); } } er.Close(); }
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(); }
public STRM(byte[] file) { EndianBinaryReader er = new EndianBinaryReader((Stream) new MemoryStream(file), Endianness.LittleEndian); bool OK; this.Header = new FileHeader.HeaderInfo(er, nameof(STRM), out OK); if (!OK) { int num1 = (int)MessageBox.Show("Error 1"); } else { this.Head = new STRM.HeadSection(er, out OK); if (!OK) { int num2 = (int)MessageBox.Show("Error 2"); } else { this.Data = new STRM.DataSection(er, out OK); if (!OK) { int num3 = (int)MessageBox.Show("Error 2"); } } } er.Close(); }
public NCER(byte[] file) { EndianBinaryReader er = new EndianBinaryReader((Stream) new MemoryStream(file), Endianness.LittleEndian); bool OK; this.Header = new FileHeader.HeaderInfo(er, "RECN", out OK); if (!OK) { // TODO: Message box // int num1 = (int) MessageBox.Show("Error 0"); } else { this.CellBankBlock = new NCER.cellBankBlock(er, out OK); if (!OK) { // TODO: Message box //int num2 = (int) MessageBox.Show("Error 1"); } else if (this.Header.dataBlocks > (ushort)1) { er.BaseStream.Position = (long)(this.CellBankBlock.Header.size + (uint)this.Header.headerSize); this.LabelBlock = new NCER.labelBlock(er, (int)this.CellBankBlock.CellDataBank.numCells, out OK); if (OK) { ; } } } er.Close(); }
public NCL(byte[] file) { EndianBinaryReader er = new EndianBinaryReader((Stream) new MemoryStream(file), Endianness.LittleEndian); bool OK; this.Header = new FileHeader.HeaderInfo(er, "NCCL", out OK); if (!OK) { int num1 = (int)MessageBox.Show("Error 0"); } else { this.PaletteData = new NCL.Palettedata(er, out OK); if (!OK) { int num2 = (int)MessageBox.Show("Error 1"); } } er.Close(); }
public NCLR(byte[] Palette, Graphic.GXTexFmt mode) { this.Header = new FileHeader.HeaderInfo("RLCN", (ushort)1); this.PaletteData = new NCLR.Palettedata(Palette, mode); }
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); }
public SDAT(byte[] file) { EndianBinaryReader er = new EndianBinaryReader((Stream) new MemoryStream(file), Endianness.LittleEndian); er.ClearMarkers(); bool OK; this.Header = new FileHeader.HeaderInfo(er, nameof(SDAT), out OK); if (!OK) { int num1 = (int)MessageBox.Show("Error 1"); } else { this.nSymbOffset = er.ReadUInt32(); this.nSymbSize = er.ReadUInt32(); this.nInfoOffset = er.ReadUInt32(); this.nInfoSize = er.ReadUInt32(); this.nFatOffset = er.ReadUInt32(); this.nFatSize = er.ReadUInt32(); this.nFileOffset = er.ReadUInt32(); this.nFileSize = er.ReadUInt32(); er.ReadBytes(16); er.BaseStream.Position = (long)this.nSymbOffset; if (this.nSymbSize != 0U) { this.SYMB = new SDAT.SymbolBlock(er, out OK); if (!OK) { int num2 = (int)MessageBox.Show("Error 2"); goto label_11; } } er.BaseStream.Position = (long)this.nInfoOffset; this.INFO = new SDAT.InfoBlock(er, out OK); if (!OK) { int num3 = (int)MessageBox.Show("Error 3"); } else { er.BaseStream.Position = (long)this.nFatOffset; this.FAT = new SDAT.FatBlock(er, out OK); if (!OK) { int num2 = (int)MessageBox.Show("Error 4"); } else { er.BaseStream.Position = (long)this.nFileOffset; this.FILE = new SDAT.FileBlock(er, out OK); if (!OK) { int num4 = (int)MessageBox.Show("Error 5"); } } } } label_11: er.ClearMarkers(); er.Close(); }
public NSCR(byte[] data, int width, int height, Graphic.NNSG2dColorMode mode) { this.Header = new FileHeader.HeaderInfo("RCSN", (ushort)1); this.ScreenData = new NSCR.Screendata(data, width, height, mode); }