public void Serialize(SerializingFile con) { if (con.isLoading) { Header = new HeaderStruct(); } Header.Serialize(con); con.Seek((int)Header.EntryOffset, SeekOrigin.Begin); for (int i = 0; i < Header.FileCount; i++) { //Debug.WriteLine($"Serialize sfar file {i} at 0x{con.Memory.Position:X8}"); var feStruct = new FileEntryStruct(); feStruct.Serialize(con, Header); Files.Add(feStruct); //Debug.WriteLine($"Data offset for {i}: 0x{Files[i].DataOffset:X8} (0x{Files[i].RealDataOffset:X8}), header at 0x{pos:X8}"); } //var ordered = Files.OrderBy(x => x.DataOffset).ToList(); //foreach (var f in ordered) //{ // Debug.WriteLine($"0x{f.DataOffset:X8} (0x{f.RealDataOffset:X8}), header at {f.MyOffset:X8}"); //} //var firstfile = Files.MinBy(x => x.RealDataOffset); if (con.isLoading) { ReadFileNames(); } }
public void Serialize(SerializingFile con) { if (con.isLoading) { Header = new HeaderStruct(); } Header.Serialize(con); con.Seek((int)Header.EntryOffset, SeekOrigin.Begin); if (con.isLoading) { Files = new FileEntryStruct[Header.FileCount]; } for (int i = 0; i < Header.FileCount; i++) { Files[i].Serialize(con, Header); } if (con.isLoading) { ReadFileNames(con); } }
public void Serialize(SerializingContainer con) { if (con.isLoading) { Header = new HeaderStruct(); } DebugLog.PrintLn("Header..."); Header.Serialize(con); con.Seek((int)Header.EntryOffset, SeekOrigin.Begin); if (con.isLoading) { Files = new FileEntryStruct[Header.FileCount]; } DebugLog.PrintLn("Files..."); for (int i = 0; i < Header.FileCount; i++) { Files[i].Serialize(con, Header); } if (con.isLoading) { ReadFileNames(con); } }