public void ExportarNCGRSprite1D(string dirNclr, string dirNcer, string dirSalvamento, bool fundoTransparente) { ArquivoNcer = new Ncer(dirNcer); if (!Directory.Exists(dirSalvamento)) { Directory.CreateDirectory(dirSalvamento); } ConversorDeImagens cv = new ConversorDeImagens(); cv.Imagem = ImagemEmBytes; foreach (var item in ArquivoNcer.GrupoDeTabelasOam) { if (item.TabelaDeOams.Count > 0) { cv.ExporteSprite1D(item.TabelaDeOams, fundoTransparente); } } }
public Ncgr(string args, string tipo) { string[] argumentos = args.Split(','); DirNcgr = argumentos[0]; Tipo = tipo; LocalParaExportacao = argumentos[argumentos.Length - 1]; using (BinaryReader br = new BinaryReader(new MemoryStream(File.ReadAllBytes(argumentos[0])))) { Cabecalho = br.ReadBytes(0x30); br.BaseStream.Position = 0x18; Altura = br.ReadInt16() * 8; Largura = br.ReadInt16() * 8; int bpp = br.ReadByte(); if (bpp == 0x3) { Bpp = ColorDepth.F4BBP; } else { Bpp = ColorDepth.F8BBP; } br.BaseStream.Position = 0x28; TamanhoGrafico = br.ReadInt32(); br.BaseStream.Position = 0x30; ImagemEmBytes = br.ReadBytes(TamanhoGrafico); } ArquivoNclr = new Nclr(argumentos[1], Bpp); if (ArquivoNclr.Diretorio.Contains("0125_idcom.nclr")) { Largura = 48; Altura = 24; } switch (tipo) { case "BG Sem Tile Map": Imagem = ExportarNCGR(); break; case "BG Com Tile Map": ArquivoNscr = new Nscr(argumentos[2]); Largura = ArquivoNscr.Largura; Altura = ArquivoNscr.Altura; Imagem = ExportarNCGRTileMap(); break; case "Sprites Modo Tile": ArquivoNcer = new Ncer(argumentos[2]); EhSprite = true; break; case "Sprites Modo 2D": ArquivoNcer = new Ncer(argumentos[2]); EhSprite = true; break; default: break; } }