/// <summary> /// Creates a new lump interpeter /// </summary> /// <param name="lump"></param> public LumpReader(Lump lump) { Lump = lump; lump.OnLumpSaved += Reload; Raw = Lump.CopyRaw(); CallAutoParser(AutoParseLumpMethod.Parse); }
/// <summary> /// Creates a new doom graphic /// </summary> /// <param name="lump"></param> /// <param name="pallete"></param> public DoomGraphic(Lump lump, DoomPallete pallete) { Width = (ushort)lump.ReadInt16(0); Height = (ushort)lump.ReadInt16(2); OffsetX = lump.ReadInt16(4); OffsetY = lump.ReadInt16(6); columns = new int[Width]; for (int i = 0; i < Width; i++) { int index = lump.ReadInt32(8 + i * 4); columns[i] = index; } this.pallete = pallete; this.lump = lump.CopyRaw(); }
/// <summary> /// The lumps raw data /// </summary> /// <returns></returns> public byte[] Raw() { return(lump.CopyRaw()); }