Esempio n. 1
0
 internal override void WriteTypeData(BinaryWriterEx bw)
 {
     bw.WriteInt32(UnkT00);
     bw.WriteInt16(UnkT04);
     bw.WriteInt16(UnkT06);
     bw.WritePattern(0x18, 0x00);
 }
Esempio n. 2
0
 public void Write(BinaryWriterEx bw)
 {
     bw.WriteInt16(X1);
     bw.WriteInt16(Y1);
     bw.WriteInt16(X2);
     bw.WriteInt16(Y2);
 }
Esempio n. 3
0
 internal override void Write(BinaryWriterEx bw, int index, List <int> offsetIndex, SortedDictionary <int, List <int> > membersOffsetIndex)
 {
     base.Write(bw, index, offsetIndex, membersOffsetIndex);
     bw.WriteInt16(Unk0A);
     membersOffsetIndex[index] = new List <int>();
     if (Members != null)
     {
         membersOffsetIndex[index].Add((int)bw.Position);
     }
     bw.ReserveInt32($"MembersOffset{index}");
     bw.WriteInt32(Unk10);
     bw.WriteInt32(0);
     bw.WriteInt32(0);
     bw.WriteInt16(Unk1C);
     bw.WriteBoolean(Reflectible);
     bw.WriteBoolean(Unk1F);
     bw.WriteInt32(Unk20);
     bw.WriteByte(Unk24);
     bw.WriteBoolean(DisableShadowSource);
     bw.WriteBoolean(DisableShadowTarget);
     bw.WriteBoolean(Unk27);
     bw.WriteSingle(Unk28);
     bw.WriteBoolean(Unk2C);
     bw.WriteBoolean(FixToCamera);
     bw.WriteBoolean(Unk2E);
     bw.WriteByte(0);
     bw.WriteInt16(Unk30);
     bw.WriteInt16(Unk32);
     bw.WriteByte(Unk34);
     bw.WriteBoolean(Unk35);
     bw.WriteBoolean(Unk36);
     bw.WriteBoolean(Unk37);
     bw.WritePattern(0x18, 0x00);
 }
Esempio n. 4
0
 internal void Write(BinaryWriterEx bw)
 {
     bw.WriteInt16(RegionIndex);
     bw.WriteInt16(0);
     bw.WriteInt32(Unk04);
     bw.WriteInt32(Unk08);
 }
Esempio n. 5
0
                internal void WriteMembers(BinaryWriterEx bw, int index, List <int> offsetIndex, SortedDictionary <int, List <int> > membersOffsetIndex)
                {
                    if (Members == null)
                    {
                        bw.FillInt32($"MembersOffset{index}", 0);
                    }
                    else
                    {
                        bw.FillInt32($"MembersOffset{index}", (int)bw.Position);
                        bw.WriteInt16(-1);
                        bw.WriteInt16((short)Members.Count);
                        membersOffsetIndex[index].Add((int)bw.Position);
                        bw.ReserveInt32($"MemberOffsetsOffset{index}");

                        // :^)
                        bw.FillInt32($"MemberOffsetsOffset{index}", (int)bw.Position);
                        for (int i = 0; i < Members.Count; i++)
                        {
                            membersOffsetIndex[index].Add((int)bw.Position);
                            bw.ReserveInt32($"MemberOffset{index}:{i}");
                        }

                        for (int i = 0; i < Members.Count; i++)
                        {
                            bw.FillInt32($"MemberOffset{index}:{i}", (int)bw.Position);
                            Members[i].Write(bw, index, i, offsetIndex);
                        }
                    }
                }
Esempio n. 6
0
 internal void Write(BinaryWriterEx bw, int index)
 {
     bw.ReserveInt32($"NameOffset{index}");
     bw.ReserveInt32($"IndicesOffset{index}");
     bw.WriteInt16((short)Indices.Count);
     bw.WriteInt16(0);
 }
Esempio n. 7
0
        /// <summary>
        /// Serializes file data to a stream.
        /// </summary>
        protected override void Write(BinaryWriterEx bw)
        {
            bw.BigEndian = BigEndian;
            bw.WriteASCII("F2TR");
            bw.WriteByte((byte)(BigEndian ? 0xFF : 0));
            bw.WriteByte(0);
            bw.WriteInt16(1);
            bw.WriteInt16(0);
            bw.WriteInt16(0x10);
            bw.WriteInt16((short)Entries.Count);
            bw.WriteInt16(0xC);

            for (int i = 0; i < Entries.Count; i++)
            {
                Entries[i].Write(bw, i);
            }

            for (int i = 0; i < Entries.Count; i++)
            {
                Entries[i].WriteIndices(bw, i);
            }

            for (int i = 0; i < Entries.Count; i++)
            {
                Entries[i].WriteName(bw, i);
            }
        }
Esempio n. 8
0
 internal override void WriteSpecific(BinaryWriterEx bw)
 {
     bw.WriteInt16(MaxNum);
     bw.WriteInt16(LimitNum);
     bw.WriteInt16(MinGenNum);
     bw.WriteInt16(MaxGenNum);
     bw.WriteSingle(MinInterval);
     bw.WriteSingle(MaxInterval);
     bw.WriteInt32(SessionCondition);
     bw.WriteSingle(UnkT14);
     bw.WriteSingle(UnkT18);
     bw.WriteInt32(0);
     bw.WriteInt32(0);
     bw.WriteInt32(0);
     bw.WriteInt32(0);
     bw.WriteInt32(0);
     bw.WriteInt32s(spawnPointIndices);
     bw.WriteInt32(0);
     bw.WriteInt32(0);
     bw.WriteInt32(0);
     bw.WriteInt32(0);
     bw.WriteInt32s(spawnPartIndices);
     bw.WriteInt32(0);
     bw.WriteInt32(0);
     bw.WriteInt32(0);
     bw.WriteInt32(0);
     bw.WriteInt32(0);
     bw.WriteInt32(0);
     bw.WriteInt32(0);
     bw.WriteInt32(0);
 }
Esempio n. 9
0
 internal override void WriteTypeData(BinaryWriterEx bw)
 {
     bw.WriteInt32(UnkT00);
     bw.WriteInt16(UnkT04);
     bw.WriteInt16(UnkT06);
     bw.WriteNull(0x18, false);
 }
Esempio n. 10
0
 private protected override void WriteTypeData(BinaryWriterEx bw)
 {
     bw.WriteByte(MaxNum);
     bw.WriteSByte(GenType);
     bw.WriteInt16(LimitNum);
     bw.WriteInt16(MinGenNum);
     bw.WriteInt16(MaxGenNum);
     bw.WriteSingle(MinInterval);
     bw.WriteSingle(MaxInterval);
     bw.WriteByte(InitialSpawnCount);
     bw.WriteByte(0);
     bw.WriteByte(0);
     bw.WriteByte(0);
     bw.WriteSingle(UnkT14);
     bw.WriteSingle(UnkT18);
     bw.WriteInt32(0);
     bw.WriteInt32(0);
     bw.WriteInt32(0);
     bw.WriteInt32(0);
     bw.WriteInt32(0);
     bw.WriteInt32s(SpawnPointIndices);
     bw.WriteInt32(0);
     bw.WriteInt32(0);
     bw.WriteInt32(0);
     bw.WriteInt32(0);
     bw.WriteInt32s(SpawnPartIndices);
     bw.WriteInt32(0);
     bw.WriteInt32(0);
     bw.WriteInt32(0);
     bw.WriteInt32(0);
     bw.WriteInt32(0);
     bw.WriteInt32(0);
     bw.WriteInt32(0);
     bw.WriteInt32(0);
 }
Esempio n. 11
0
 internal void Write(BinaryWriterEx bw)
 {
     bw.WriteInt32(Unk00);
     bw.WriteInt16(Unk04);
     bw.WriteInt16(Unk06);
     bw.WriteInt16(Unk08);
 }
Esempio n. 12
0
                internal override void WriteSpecific(BinaryWriterEx bw, Dictionary <string, int> stringOffsets)
                {
                    bw.WriteByte((byte)BlendMode);
                    bw.WriteBoolean(Unknown != null);
                    bw.WriteInt16(LineSpacing);
                    bw.WriteInt32(PaletteColor);
                    WriteColor(bw, CustomColor);
                    bw.WriteInt16(FontSize);
                    bw.WriteByte((byte)Alignment);
                    bw.WriteByte((byte)TextType);
                    bw.WriteInt32(0x1C);

                    if (TextType == TxtType.Literal)
                    {
                        bw.WriteInt32(stringOffsets[TextLiteral]);
                    }
                    else if (TextType == TxtType.FMG)
                    {
                        bw.WriteInt32(CharLength);
                        bw.WriteInt32(TextID);
                    }
                    else if (TextType == TxtType.Dynamic)
                    {
                        bw.WriteInt32(CharLength);
                    }

                    WriteSubtype(bw);

                    Unknown?.Write(bw);
                }
Esempio n. 13
0
 internal override void WriteSpecific(BinaryWriterEx bw, long start)
 {
     bw.FillInt64("TypeDataOffset", bw.Position - start);
     bw.WriteInt16(MessageID);
     bw.WriteInt16(UnkT02);
     bw.WriteInt32(Hidden ? 1 : 0);
 }
Esempio n. 14
0
            internal void Write(BinaryWriterEx bw, int version, int index)
            {
                bw.WriteVector3(Position);
                bw.WriteInt16(Section0Index);
                bw.WriteInt16(MainID);

                if (version < 2)
                {
                    if (SiblingDistances.Count > 16)
                    {
                        throw new InvalidDataException("MapNode distance count must not exceed 16 in DS3/BB.");
                    }

                    foreach (float distance in SiblingDistances)
                    {
                        bw.WriteUInt16((ushort)(distance == -1 ? 0xFFFF : Math.Round(distance * 100)));
                    }

                    for (int i = 0; i < 16 - SiblingDistances.Count; i++)
                    {
                        bw.WriteUInt16(0xFFFF);
                    }
                }
                else
                {
                    bw.WriteInt32(SiblingDistances.Count);
                    bw.WriteInt32(Unk14);
                    bw.ReserveInt32($"SubIDsOffset{index}");
                    bw.WriteInt32(0);
                }
            }
Esempio n. 15
0
            internal void Write(BinaryWriterEx bw, GameType game)
            {
                if (game == GameType.BB)
                {
                    bw.WriteInt32(RagdollParamID);
                    bw.WriteInt16(DamageAnimID);
                    bw.WriteByte(NPCPartGroupIndex);
                    bw.WriteByte(Unknown);
                    bw.WriteSByte(UnknownBB);
                    bw.WriteByte(0);
                    bw.WriteByte(0);
                    bw.WriteByte(0);
                    bw.WriteInt32(0);
                }
                else
                {
                    bw.WriteInt16((short)RagdollParamID);
                    bw.WriteInt16(DamageAnimID);
                    bw.WriteByte(NPCPartGroupIndex);
                    bw.WriteByte(Unknown);
                    bw.WriteByte(0);
                    bw.WriteByte(0);

                    if (game == GameType.DS3)
                    {
                        bw.WriteInt64(0);
                    }
                }
            }
Esempio n. 16
0
 internal void Write(BinaryWriterEx bw, int index)
 {
     bw.WriteInt16((short)HeavyStates.Count);
     bw.WriteInt16((short)LightStates.Count);
     bw.WriteInt32(0);
     bw.ReserveInt32($"HeavyOffset[{index}]");
     bw.ReserveInt32($"LightOffset[{index}]");
 }
Esempio n. 17
0
 private protected override void WriteTypeData(BinaryWriterEx bw)
 {
     bw.WriteInt32(MapObjectInstanceParamID);
     bw.WriteInt16(UnkT04);
     bw.WriteInt16(0);
     bw.WriteInt32(0);
     bw.WriteInt32(0);
 }
Esempio n. 18
0
 internal void Write(BinaryWriterEx bw)
 {
     bw.WriteInt16(Start);
     bw.WriteInt16(Duration);
     bw.WriteByte(BeginStrength);
     bw.WriteByte(EndStrength);
     bw.WriteInt16(0);
 }
Esempio n. 19
0
 private protected override void WriteTypeData(BinaryWriterEx bw)
 {
     bw.WriteInt16(MessageID);
     bw.WriteInt16(UnkT02);
     bw.WriteBoolean(Hidden);
     bw.WriteByte(0);
     bw.WriteInt16(0);
 }
Esempio n. 20
0
 internal override void Write(BinaryWriterEx bw, int id)
 {
     base.Write(bw, id);
     bw.WriteInt16(MessageID);
     bw.WriteInt16(UnkT02);
     bw.WriteBoolean(Hidden);
     bw.WriteByte(0);
     bw.WriteInt16(0);
 }
Esempio n. 21
0
 internal override void Write(BinaryWriterEx bw, int id)
 {
     base.Write(bw, id);
     bw.WriteInt32(ObjActEntityID);
     bw.WriteInt32(ObjActPartIndex);
     bw.WriteInt16(ObjActParamID);
     bw.WriteInt16(UnkT0A);
     bw.WriteInt32(EventFlagID);
 }
Esempio n. 22
0
 internal override void WriteTypeData(BinaryWriterEx bw)
 {
     bw.WriteInt32(UnkT00);
     bw.WriteInt32s(EnemyIndices);
     bw.WriteInt32s(TalkIDs);
     bw.WriteInt16(UnkT44);
     bw.WriteInt16(UnkT46);
     bw.WriteInt32(UnkT48);
     bw.WritePattern(0x34, 0x00);
 }
Esempio n. 23
0
 internal override void WriteSpecific(BinaryWriterEx bw, Dictionary <string, int> stringOffsets)
 {
     bw.WriteInt16(TexLeftEdge);
     bw.WriteInt16(TexTopEdge);
     bw.WriteInt16(TexRightEdge);
     bw.WriteInt16(TexBottomEdge);
     bw.WriteInt16(TextureIndex);
     bw.WriteByte((byte)Orientation);
     bw.WriteByte((byte)BlendMode);
 }
Esempio n. 24
0
            internal void Write(BinaryWriterEx bw)
            {
                bw.WriteInt16(Unk00);
                bw.WriteInt16((short)Members.Count);
                bw.WriteInt32(0);
                bw.WriteInt64(0x10);

                foreach (var member in Members)
                    member.Write(bw);
            }
Esempio n. 25
0
 internal override void WriteTypeData(BinaryWriterEx bw)
 {
     bw.WriteInt32(UnkT00);
     bw.WriteInt32s(UnkT04);
     bw.WriteInt32s(UnkT24);
     bw.WriteInt16(UnkT44);
     bw.WriteInt16(UnkT46);
     bw.WriteInt32(UnkT48);
     bw.WriteNull(0x34, false);
 }
Esempio n. 26
0
        internal override void Write(BinaryWriterEx bw)
        {
            bool bigEndian = Format == EMEVD.Game.DarkSouls1BE;
            bool is64Bit   = Format >= EMEVD.Game.Bloodborne;

            bw.WriteASCII("ELD\0");
            bw.WriteBoolean(bigEndian);
            bw.WriteSByte((sbyte)(is64Bit ? -1 : 0));
            bw.WriteByte(0);
            bw.WriteByte(0);
            bw.BigEndian  = bigEndian;
            bw.VarintLong = is64Bit;

            bw.WriteInt16(0x65);
            bw.WriteInt16(0xCC);
            bw.ReserveInt32("FileSize");

            bw.WriteVarint(Events.Count);
            bw.ReserveVarint("EventsOffset");
            bw.WriteVarint(0);
            bw.ReserveVarint("Offset2");
            bw.WriteVarint(0);
            bw.ReserveVarint("Offset3");
            bw.ReserveVarint("StringsLength");
            bw.ReserveVarint("StringsOffset");
            if (!is64Bit)
            {
                bw.WriteInt32(0);
                bw.WriteInt32(0);
            }

            bw.FillVarint("EventsOffset", bw.Position);
            for (int i = 0; i < Events.Count; i++)
            {
                Events[i].Write(bw, Format, i);
            }

            bw.FillVarint("Offset2", bw.Position);
            bw.FillVarint("Offset3", bw.Position);

            long stringsOffset = bw.Position;

            bw.FillVarint("StringsOffset", bw.Position);
            for (int i = 0; i < Events.Count; i++)
            {
                Events[i].WriteName(bw, i, stringsOffset);
            }
            if ((bw.Position - stringsOffset) % 0x10 > 0)
            {
                bw.WritePattern(0x10 - (int)(bw.Position - stringsOffset) % 0x10, 0x00);
            }
            bw.FillVarint("StringsLength", bw.Position - stringsOffset);

            bw.FillInt32("FileSize", (int)bw.Position);
        }
Esempio n. 27
0
 internal override void Write(BinaryWriterEx bw, int id)
 {
     base.Write(bw, id);
     bw.WriteInt32(0);
     bw.WriteInt32(CollisionIndex);
     bw.WriteInt32(UnkT08);
     bw.WriteInt16(UnkT0C);
     bw.WriteInt16(UnkT0E);
     bw.WriteInt32(UnkT10);
     bw.WriteInt32(0);
 }
Esempio n. 28
0
 private protected override void WriteTypeData(BinaryWriterEx bw)
 {
     bw.WriteInt32(0);
     bw.WriteSByte(BreakTerm);
     bw.WriteSByte(NetSyncType);
     bw.WriteInt16(0);
     bw.WriteInt16(InitAnimID);
     bw.WriteInt16(UnkT0E);
     bw.WriteInt32(UnkT10);
     bw.WriteInt32(0);
     bw.WriteInt32(0);
 }
            internal void Write(BinaryWriterEx bw)
            {
                bw.WriteInt16(PartIndex);
                bw.WriteInt16((short)Bones.Count);
                bw.WriteInt32(0);
                bw.WriteInt64(0x10);

                foreach (var member in Bones)
                {
                    member.Write(bw);
                }
            }
Esempio n. 30
0
            internal void Write(BinaryWriterEx bw, BTPBVersion version)
            {
                bw.WriteInt16s(Coefficients);
                bw.WriteInt16(LightMask);
                bw.WriteInt16(Unk1A);

                if (version >= BTPBVersion.Bloodborne)
                {
                    bw.WriteVector3(Position);
                    bw.WritePattern(0x20, 0x00);
                }
            }