public Oam(Oam oam, int resX, int resY) { _atributosOBJ0 = oam._atributosOBJ0; _atributosOBJ1 = oam._atributosOBJ1; _atributosOBJ2 = oam._atributosOBJ2; ObtenhaAtribuosObj0(oam._atributosOBJ0); ObtenhaAtribuosObj1(oam._atributosOBJ1); ObtenhaAtribuosObj2(oam._atributosOBJ2); Imagem = new Bitmap(resX, resY); using (Graphics gg = Graphics.FromImage(Imagem)) { SolidBrush sb = new SolidBrush(oam.Paleta[0]); Rectangle rect = new Rectangle(0, 0, resX, resY); gg.FillRectangle(sb, rect); gg.Dispose(); sb.Dispose(); Retangulo = rect; } Paleta = oam.Paleta; }
public void AdicionarOam(Oam oam) { TabelaDeOams.Add(oam); }
public Ncer(string dir) { using (BinaryReader br = new BinaryReader(new MemoryStream(File.ReadAllBytes(dir)))) { Cabecalho = br.ReadBytes(0x30); br.BaseStream.Position = 0x14; int offsetLbal = br.ReadInt32() + 0x10; br.BaseStream.Position = offsetLbal; byte v = br.ReadByte(); int contador = 0; if (v != 0x4C) { contador++; while (true) { v = br.ReadByte(); if (v == 0x4C) { break; } contador++; } offsetLbal += contador; br.BaseStream.Position = offsetLbal; } else { br.BaseStream.Position -= 1; } br.BaseStream.Seek(4, SeekOrigin.Current); int tamanhoSecaoLb = br.ReadInt32(); br.BaseStream.Position = offsetLbal; Lbal = br.ReadBytes(tamanhoSecaoLb); br.BaseStream.Seek(4, SeekOrigin.Current); int tamanhoSecaoTx = br.ReadInt32(); br.BaseStream.Position = offsetLbal + tamanhoSecaoLb; Txeu = br.ReadBytes(tamanhoSecaoTx); br.BaseStream.Position = 0x18; int numeroDeTabelasOam = br.ReadInt32(); int posTabela = 0x30; int posicaoEntradas = (numeroDeTabelasOam * 8) + 0x30; for (int i = 0; i < numeroDeTabelasOam; i++) { br.BaseStream.Position = posTabela; int qtdEntradas = br.ReadInt16(); int id = br.ReadInt16(); int offsetEntrada = br.ReadInt32(); br.BaseStream.Position = offsetEntrada + posicaoEntradas; Oams listaDeoams = new Oams(posTabela, (ushort)qtdEntradas, (ushort)id); for (int y = 0; y < qtdEntradas; y++) { ushort atb0 = br.ReadUInt16(); ushort atb1 = br.ReadUInt16(); ushort atb2 = br.ReadUInt16(); Oam oam = new Oam(atb0, atb1, atb2); listaDeoams.AdicionarOam(oam); } // listaDeoams.VariosOam.Reverse(); GrupoDeTabelasOam.Add(listaDeoams); posTabela += 8; } } }