public void Load(Stream source_stream) { BinaryReader reader = new BinaryReader(source_stream, System.Text.Encoding.Default); header = new NiHeader(); header.Read(reader); header.SetBlocksOffset(source_stream.Position); //header.Dump(); int num_blocks = header.blocks.Length; for (int i = 0; i < num_blocks; i++) { header.blocks[i].Read(reader); } DumpNodes(); }
//TODO: nif static NiHeader GetHeader(Stream source_stream) { BinaryReader reader = new BinaryReader(source_stream, System.Text.Encoding.Default); NiHeader header = new NiHeader(); header.Read(reader); header.SetBlocksOffset(source_stream.Position); //header.Dump(); int num_blocks = header.blocks.Length; for (int i = 0; i < num_blocks; i++) { header.blocks[i].Read(reader); } return(header); }