public static void W(this Stream stream, POF pof, bool shiftX = false, int depth = 0) { byte[] data = pof.Write(shiftX); Header header = new Header { Depth = depth, Format = Format.F2LE, Length = 0x20, Signature = shiftX ? 0x31464F50 : 0x30464F50 }; header.DataSize = header.SectionSize = data.Length; stream.W(header); stream.W(data); }
public static void W(this Stream stream, POF pof, bool shiftX = false, uint depth = 0) { byte[] data = pof.Write(shiftX); Header header = new Header { Depth = depth, Format = Format.F2, Length = 0x20, Signature = shiftX ? 0x31464F50u : 0x30464F50u, UseSectionSize = true }; header.DataSize = header.SectionSize = (uint)data.Length.A(0x10); stream.W(header); stream.W(data); for (int c = data.Length.A(0x10) - data.Length; c > 0; c--) { stream.W((byte)0); } }