internal void UnParse(Stream s) { if (ageGender == null) { ageGender = new AgeGenderFlags(handler); } ageGender.UnParse(s); new BinaryWriter(s).Write((uint)facialRegion); if (lod1 == null) { lod1 = new LODSection(handler); } lod1.UnParse(s); if (lod2 == null) { lod2 = new LODSection(handler); } lod2.UnParse(s); if (lod3 == null) { lod3 = new LODSection(handler); } lod3.UnParse(s); if (lod4 == null) { lod4 = new LODSection(handler); } lod4.UnParse(s); }
internal void UnParse(Stream s) { BinaryWriter w = new BinaryWriter(s); if (ageGender == null) { ageGender = new AgeGenderFlags(handler); } ageGender.UnParse(s); w.Write(amount); w.Write(index); }
protected override Stream UnParse() { long posn, tgiPosn, end; MemoryStream s = new MemoryStream(); BinaryWriter w = new BinaryWriter(s); w.Write(version); posn = s.Position; w.Write((int)0); //offset if (presets == null) { presets = new PresetList(OnResourceChanged); } presets.UnParse(s); BigEndianUnicodeString.Write(s, unknown1); w.Write(sortPriority); w.Write(unknown2); w.Write((uint)clothing); w.Write((uint)dataType); if (ageGender == null) { ageGender = new AgeGenderFlags(OnResourceChanged); } ageGender.UnParse(s); w.Write((uint)clothingCategory); w.Write(casPart1Index); w.Write(casPart2Index); w.Write(blendInfoFatIndex); w.Write(blendInfoFitIndex); w.Write(blendInfoThinIndex); w.Write(blendInfoSpecialIndex); w.Write(overlayPriority); if (tgiBlocks == null) { tgiBlocks = new CountedTGIBlockList(OnResourceChanged, "IGT"); } if (vpxyIndexes == null) { vpxyIndexes = new ByteIndexList(OnResourceChanged, ReadByte, WriteByte, byte.MaxValue, tgiBlocks); } vpxyIndexes.UnParse(s); if (lodInfo == null) { lodInfo = new LODInfoEntryList(OnResourceChanged); } lodInfo.UnParse(s); if (diffuse1Indexes == null) { diffuse1Indexes = new ByteIndexList(OnResourceChanged, ReadByte, WriteByte, byte.MaxValue, tgiBlocks); } diffuse1Indexes.UnParse(s); if (specular1Indexes == null) { specular1Indexes = new ByteIndexList(OnResourceChanged, ReadByte, WriteByte, byte.MaxValue, tgiBlocks); } specular1Indexes.UnParse(s); if (diffuse2Indexes == null) { diffuse2Indexes = new ByteIndexList(OnResourceChanged, ReadByte, WriteByte, byte.MaxValue, tgiBlocks); } diffuse2Indexes.UnParse(s); if (specular2Indexes == null) { specular2Indexes = new ByteIndexList(OnResourceChanged, ReadByte, WriteByte, byte.MaxValue, tgiBlocks); } specular2Indexes.UnParse(s); if (bondIndexes == null) { bondIndexes = new ByteIndexList(OnResourceChanged, ReadByte, WriteByte, byte.MaxValue, tgiBlocks); } bondIndexes.UnParse(s); BigEndianUnicodeString.Write(s, unknown4); tgiPosn = s.Position; w.Write((byte)tgiBlocks.Count); tgiBlocks.UnParse(s); end = s.Position; s.Position = posn; w.Write((int)(tgiPosn - posn - sizeof(int))); s.Position = end; vpxyIndexes.ParentTGIBlocks = diffuse1Indexes.ParentTGIBlocks = specular1Indexes.ParentTGIBlocks = diffuse2Indexes.ParentTGIBlocks = specular2Indexes.ParentTGIBlocks = bondIndexes.ParentTGIBlocks = tgiBlocks; s.Flush(); return(s); }