internal static void WriteBHFHeader(IBXF3 bxf, BinaryWriterEx bw, List <BinderFileHeader> fileHeaders) { bw.BigEndian = bxf.BigEndian || Binder.ForceBigEndian(bxf.Format); bw.WriteASCII("BHF3"); bw.WriteFixStr(bxf.Version, 8); Binder.WriteFormat(bw, bxf.BitBigEndian, bxf.Format); bw.WriteByte(0); bw.WriteByte(0); bw.WriteByte(0); bw.WriteInt32(fileHeaders.Count); bw.WriteInt32(0); bw.WriteInt32(0); bw.WriteInt32(0); for (int i = 0; i < fileHeaders.Count; i++) { fileHeaders[i].WriteBinder3FileHeader(bw, bxf.Format, bxf.BitBigEndian, i); } for (int i = 0; i < fileHeaders.Count; i++) { fileHeaders[i].WriteFileName(bw, bxf.Format, false, i); } }
internal static List <BinderFileHeader> ReadBHFHeader(IBXF3 bxf, BinaryReaderEx br) { br.AssertASCII("BHF3"); bxf.Version = br.ReadFixStr(8); bxf.BitBigEndian = br.GetBoolean(0xE); bxf.Format = Binder.ReadFormat(br, bxf.BitBigEndian); bxf.BigEndian = br.ReadBoolean(); br.AssertBoolean(bxf.BitBigEndian); br.AssertByte(0); br.BigEndian = bxf.BigEndian || Binder.ForceBigEndian(bxf.Format); int fileCount = br.ReadInt32(); br.AssertInt32(0); br.AssertInt32(0); br.AssertInt32(0); var fileHeaders = new List <BinderFileHeader>(fileCount); for (int i = 0; i < fileCount; i++) { fileHeaders.Add(BinderFileHeader.ReadBinder3FileHeader(br, bxf.Format, bxf.BitBigEndian)); } return(fileHeaders); }
internal static void WriteBDFHeader(IBXF3 bxf, BinaryWriterEx bw) { bw.WriteASCII("BDF3"); bw.WriteFixStr(bxf.Version, 8); bw.WriteInt32(0); }