internal override void Write(BinaryWriterEx bw, int id) { long start = bw.Position; bw.ReserveInt32("NameOffset"); bw.WriteUInt32((uint)Type); bw.WriteInt32(id); bw.WriteInt32(ModelIndex); bw.ReserveInt32("SibOffset"); bw.WriteVector3(Position); bw.WriteVector3(Rotation); bw.WriteVector3(Scale); bw.WriteUInt32s(DrawGroups); bw.WriteUInt32s(DispGroups); bw.ReserveInt32("EntityDataOffset"); bw.ReserveInt32("TypeDataOffset"); bw.WriteInt32(0); long stringsStart = bw.Position; bw.FillInt32("NameOffset", (int)(bw.Position - start)); bw.WriteShiftJIS(MSB.ReambiguateName(Name), true); bw.FillInt32("SibOffset", (int)(bw.Position - start)); bw.WriteShiftJIS(Placeholder, true); bw.Pad(4); if (bw.Position - stringsStart < 0x14) { bw.WritePattern((int)(0x14 - (bw.Position - stringsStart)), 0x00); } bw.FillInt32("EntityDataOffset", (int)(bw.Position - start)); bw.WriteInt32(EntityID); bw.WriteByte(LightID); bw.WriteByte(FogID); bw.WriteByte(ScatterID); bw.WriteByte(LensFlareID); bw.WriteByte(ShadowID); bw.WriteByte(DofID); bw.WriteByte(ToneMapID); bw.WriteByte(ToneCorrectID); bw.WriteByte(LanternID); bw.WriteByte(LodParamID); bw.WriteByte(0); bw.WriteByte(IsShadowSrc); bw.WriteByte(IsShadowDest); bw.WriteByte(IsShadowOnly); bw.WriteByte(DrawByReflectCam); bw.WriteByte(DrawOnlyReflectCam); bw.WriteByte(UseDepthBiasFloat); bw.WriteByte(DisablePointLightEffect); bw.WriteByte(0); bw.WriteByte(0); bw.FillInt32("TypeDataOffset", (int)(bw.Position - start)); }
private protected override void WriteTypeData(BinaryWriterEx bw) { bw.WriteUInt32s(NvmGroups); bw.WriteInt32(0); bw.WriteInt32(0); bw.WriteInt32(0); bw.WriteInt32(0); }
internal override void Write(BinaryWriterEx bw, int id) { long start = bw.Position; bw.ReserveVarint("NameOffset"); bw.WriteByte((byte)Type); bw.WriteByte(0); bw.WriteInt16((short)id); bw.WriteInt16(ModelIndex); bw.WriteInt16(0); bw.WriteVector3(Position); bw.WriteVector3(Rotation); bw.WriteVector3(Scale); bw.WriteUInt32s(DrawGroups); bw.WriteInt32(Unk44); bw.WriteInt32(Unk48); bw.WriteInt32(Unk4C); bw.WriteInt32(Unk50); bw.WriteUInt32s(DispGroups); bw.WriteInt32(Unk64); bw.WriteInt32(0); bw.WriteByte(Unk6C); bw.WriteByte(0); bw.WriteByte(Unk6E); bw.WriteByte(0); bw.ReserveVarint("TypeDataOffset"); if (bw.VarintLong) { bw.WriteInt64(0); } long nameStart = bw.Position; int namePad = bw.VarintLong ? 0x20 : 0x2C; bw.FillVarint("NameOffset", nameStart - start); bw.WriteUTF16(MSB.ReambiguateName(Name), true); if (bw.Position - nameStart < namePad) { bw.Position += namePad - (bw.Position - nameStart); } bw.Pad(bw.VarintSize); bw.FillVarint("TypeDataOffset", bw.Position - start); WriteTypeData(bw); }
internal override void Write(BinaryWriterEx bw, int id) { base.Write(bw, id); bw.WriteUInt32s(NvmGroups); bw.WriteInt32(0); bw.WriteInt32(0); bw.WriteInt32(0); bw.WriteInt32(0); }
internal override void Write(BinaryWriterEx bw, int id) { long start = bw.Position; bw.ReserveInt32("NameOffset"); bw.WriteUInt32((uint)Type); bw.WriteInt32(id); bw.WriteInt32(ModelIndex); bw.ReserveInt32("SibOffset"); bw.WriteVector3(Position); bw.WriteVector3(Rotation); bw.WriteVector3(Scale); bw.WriteUInt32s(DrawGroups); bw.WriteUInt32s(DispGroups); bw.ReserveInt32("EntityDataOffset"); bw.ReserveInt32("TypeDataOffset"); bw.WriteInt32(0); bw.WriteInt32(0); long stringsStart = bw.Position; bw.FillInt32("NameOffset", (int)(bw.Position - start)); bw.WriteShiftJIS(MSB.ReambiguateName(Name), true); bw.FillInt32("SibOffset", (int)(bw.Position - start)); bw.WriteShiftJIS(SibPath, true); bw.Pad(4); if (bw.Position - stringsStart < 0x10) { bw.WritePattern((int)(0x10 - (bw.Position - stringsStart)), 0x00); } bw.FillInt32("EntityDataOffset", (int)(bw.Position - start)); WriteEntityData(bw); bw.FillInt32("TypeDataOffset", (int)(bw.Position - start)); WriteTypeData(bw); }
private protected override void WriteTypeData(BinaryWriterEx bw) { bw.WriteByte(HitFilterID); bw.WriteByte(SoundSpaceType); bw.WriteInt16(EnvLightMapSpotIndex); bw.WriteSingle(ReflectPlaneHeight); bw.WriteUInt32s(NvmGroups); bw.WriteInt16s(RefTexIDs); bw.WriteInt16(UnkT38); bw.WriteInt16(MapNameID); bw.WriteInt32(0); bw.WriteInt32(0); bw.WriteInt32(0); bw.WriteInt32(0); }
internal override void Write(BinaryWriterEx bw, int index) { long start = bw.Position; bw.ReserveInt64("NameOffset"); bw.WriteUInt16((ushort)Type); bw.WriteInt16((short)index); bw.WriteInt32(ModelIndex); bw.WriteVector3(Position); bw.WriteVector3(Rotation); bw.WriteVector3(Scale); bw.WriteUInt32s(DrawGroups); bw.WriteInt32(Unk44); bw.WriteInt32(Unk48); bw.WriteInt32(Unk4C); bw.WriteInt32(Unk50); bw.WriteUInt32s(DispGroups); bw.WriteInt32(Unk64); bw.WriteInt32(Unk68); bw.WriteInt32(Unk6C); bw.ReserveInt64("TypeDataOffset"); bw.WriteInt64(0); long nameStart = bw.Position; bw.FillInt64("NameOffset", nameStart - start); bw.WriteUTF16(MSB.ReambiguateName(Name), true); if (bw.Position - nameStart < 0x20) { bw.Position += 0x20 - (bw.Position - nameStart); } bw.Pad(8); bw.FillInt64("TypeDataOffset", bw.Position - start); WriteTypeData(bw); }
internal override void Write(BinaryWriterEx bw, int id) { base.Write(bw, id); bw.WriteByte(HitFilterID); bw.WriteByte(SoundSpaceType); bw.WriteInt16(EnvLightMapSpotIndex); bw.WriteSingle(ReflectPlaneHeight); bw.WriteUInt32s(NvmGroups); bw.WriteInt32s(VagrantEntityIDs); bw.WriteInt16(MapNameID); bw.WriteInt16(DisableStart); bw.WriteInt32(DisableBonfireEntityID); bw.WriteInt32(-1); bw.WriteInt32(-1); bw.WriteInt32(-1); bw.WriteInt32(PlayRegionID); bw.WriteInt16(LockCamParamID1); bw.WriteInt16(LockCamParamID2); bw.WriteInt32(0); bw.WriteInt32(0); bw.WriteInt32(0); bw.WriteInt32(0); }
private protected override void WriteTypeData(BinaryWriterEx bw) { bw.WriteByte(HitFilterID); bw.WriteByte(SoundSpaceType); bw.WriteInt16(EnvLightMapSpotIndex); bw.WriteSingle(ReflectPlaneHeight); bw.WriteUInt32s(NvmGroups); bw.WriteInt32s(VagrantEntityIDs); bw.WriteInt16(MapNameID); bw.WriteBoolean(DisableStart); bw.WriteByte(UnkT27); bw.WriteInt32(DisableBonfireEntityID); bw.WriteInt32(-1); bw.WriteInt32(-1); bw.WriteInt32(-1); bw.WriteInt32(PlayRegionID); bw.WriteInt16(LockCamParamID1); bw.WriteInt16(LockCamParamID2); bw.WriteInt32(0); bw.WriteInt32(0); bw.WriteInt32(0); bw.WriteInt32(0); }
internal void Write(BinaryWriterEx bw) { long start = bw.Position; bw.ReserveInt64("DescOffset"); bw.ReserveInt64("NameOffset"); bw.WriteInt32(ModelLocalID); bw.WriteUInt32((uint)Type); bw.WriteInt32(ID); bw.WriteInt32(modelIndex); bw.ReserveInt64("PlaceholderOffset"); bw.WriteVector3(Position); bw.WriteVector3(Rotation); bw.WriteVector3(Scale); bw.WriteUInt32s(DrawGroups); bw.WriteUInt32s(DispGroups); bw.WriteUInt32s(BackreadGroups); bw.WriteInt32(UnkFA4); bw.ReserveInt64("BaseDataOffset"); bw.ReserveInt64("TypeDataOffset"); bw.ReserveInt64("UnkOffset1"); bw.ReserveInt64("UnkOffset2"); bw.FillInt64("DescOffset", bw.Position - start); bw.WriteUTF16(Description, true); bw.FillInt64("NameOffset", bw.Position - start); bw.WriteUTF16(Name, true); if (Placeholder == null) { bw.FillInt64("PlaceholderOffset", 0); } else { bw.FillInt64("PlaceholderOffset", bw.Position - start); bw.WriteUTF16(Placeholder, true); } bw.Pad(8); bw.FillInt64("BaseDataOffset", bw.Position - start); bw.WriteInt32(EventEntityID); bw.WriteSByte(OldLightID); bw.WriteSByte(OldFogID); bw.WriteSByte(OldScatterID); bw.WriteSByte(OldLensFlareID); bw.WriteInt32(0); bw.WriteSByte(OldLanternID); bw.WriteSByte(OldLodParamID); bw.WriteSByte(UnkB0E); bw.WriteBoolean(OldIsShadowDest); bw.FillInt64("TypeDataOffset", bw.Position - start); if (UnkOffset1Delta == 0) { bw.FillInt64("UnkOffset1", 0); } else { bw.FillInt64("UnkOffset1", bw.Position - start + UnkOffset1Delta); } if (UnkOffset2Delta == 0) { bw.FillInt64("UnkOffset2", 0); } else { bw.FillInt64("UnkOffset2", bw.Position - start + UnkOffset2Delta); } WriteSpecific(bw); }