示例#1
0
                public static void Write(BinaryWriterEx bw, BinderFile file, int index, Binder.Format format)
                {
                    bw.WriteByte((byte)file.Flags);
                    bw.WriteByte(0);
                    bw.WriteByte(0);
                    bw.WriteByte(0);

                    bw.WriteInt32(-1);
                    bw.ReserveInt64($"FileSize{index}");
                    if (Binder.HasUncompressedSize(format))
                    {
                        bw.WriteInt64(file.Bytes.LongLength);
                    }

                    if (Binder.HasLongOffsets(format))
                    {
                        bw.ReserveInt64($"FileOffset{index}");
                    }
                    else
                    {
                        bw.ReserveUInt32($"FileOffset{index}");
                    }

                    if (Binder.HasID(format))
                    {
                        bw.WriteInt32(file.ID);
                    }

                    bw.ReserveUInt32($"FileName{index}");
                }
 public void WriteHeader(BinaryWriterEx bw, HKX.HKXVariation variation)
 {
     bw.WriteFixStr(SectionTag, 19);
     bw.WriteByte(0xFF);
     bw.ReserveUInt32("absoffset" + SectionID);
     bw.ReserveUInt32("locoffset" + SectionID);
     bw.ReserveUInt32("globoffset" + SectionID);
     bw.ReserveUInt32("virtoffset" + SectionID);
     bw.ReserveUInt32("expoffset" + SectionID);
     bw.ReserveUInt32("impoffset" + SectionID);
     bw.ReserveUInt32("endoffset" + SectionID);
     if (variation == HKX.HKXVariation.HKXBloodBorne || variation == HKX.HKXVariation.HKXDS3)
     {
         bw.WriteUInt32(0xFFFFFFFF);
         bw.WriteUInt32(0xFFFFFFFF);
         bw.WriteUInt32(0xFFFFFFFF);
         bw.WriteUInt32(0xFFFFFFFF);
     }
 }