예제 #1
0
 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);
 }
예제 #2
0
            void Parse(Stream s)
            {
                BinaryReader r = new BinaryReader(s);

                ageGender = new AgeGenderFlags(handler, s);
                amount    = r.ReadSingle();
                index     = r.ReadInt32();
            }
예제 #3
0
 void Parse(Stream s)
 {
     ageGender    = new AgeGenderFlags(handler, s);
     facialRegion = (FacialRegionFlags) new BinaryReader(s).ReadUInt32();
     lod1         = new LODSection(handler, s);
     lod2         = new LODSection(handler, s);
     lod3         = new LODSection(handler, s);
     lod4         = new LODSection(handler, s);
 }
예제 #4
0
 public Section1Entry(EventHandler handler)
     : base(handler)
 {
     ageGender = new AgeGenderFlags(handler);
     lod1      = new LODSection(handler);
     lod2      = new LODSection(handler);
     lod3      = new LODSection(handler);
     lod4      = new LODSection(handler);
 }
예제 #5
0
 public Entry(EventHandler handler, AgeGenderFlags ageGender, float amount, int index,
              DependentList <TGIBlock> ParentTGIBlocks = null)
     : base(handler)
 {
     this.ParentTGIBlocks = ParentTGIBlocks;
     this.ageGender       = new AgeGenderFlags(handler, ageGender);
     this.amount          = amount;
     this.index           = index;
 }
예제 #6
0
            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);
            }
예제 #7
0
        void Parse(Stream s)
        {
            int tgiPosn;

            BinaryReader r = new BinaryReader(s);

            version               = r.ReadUInt32();
            tgiPosn               = r.ReadInt32() + 8;
            presets               = new PresetList(OnResourceChanged, s);
            unknown1              = BigEndianUnicodeString.Read(s);
            sortPriority          = r.ReadSingle();
            unknown2              = r.ReadByte();
            clothing              = (ClothingType)r.ReadUInt32();
            dataType              = (DataTypeFlags)r.ReadUInt32();
            ageGender             = new AgeGenderFlags(OnResourceChanged, s);
            clothingCategory      = (ClothingCategoryFlags)r.ReadUInt32();
            casPart1Index         = r.ReadByte();
            casPart2Index         = r.ReadByte();
            blendInfoFatIndex     = r.ReadByte();
            blendInfoFitIndex     = r.ReadByte();
            blendInfoThinIndex    = r.ReadByte();
            blendInfoSpecialIndex = r.ReadByte();
            overlayPriority       = r.ReadUInt32();
            vpxyIndexes           = new ByteIndexList(OnResourceChanged, s, ReadByte, WriteByte);
            lodInfo               = new LODInfoEntryList(OnResourceChanged, s);
            diffuse1Indexes       = new ByteIndexList(OnResourceChanged, s, ReadByte, WriteByte);
            specular1Indexes      = new ByteIndexList(OnResourceChanged, s, ReadByte, WriteByte);
            diffuse2Indexes       = new ByteIndexList(OnResourceChanged, s, ReadByte, WriteByte);
            specular2Indexes      = new ByteIndexList(OnResourceChanged, s, ReadByte, WriteByte);
            bondIndexes           = new ByteIndexList(OnResourceChanged, s, ReadByte, WriteByte);
            unknown4              = BigEndianUnicodeString.Read(s);

            if (tgiPosn != s.Position)
            {
                throw new InvalidDataException(String.Format("Position of TGIBlock read: 0x{0:X8}, actual: 0x{1:X8}",
                                                             tgiPosn, s.Position));
            }

            byte count = r.ReadByte();

            tgiBlocks = new CountedTGIBlockList(OnResourceChanged, "IGT", count, s);

            vpxyIndexes.ParentTGIBlocks         = diffuse1Indexes.ParentTGIBlocks = specular1Indexes.ParentTGIBlocks =
                diffuse2Indexes.ParentTGIBlocks = specular2Indexes.ParentTGIBlocks = bondIndexes.ParentTGIBlocks = tgiBlocks;
        }
예제 #8
0
 public Entry(EventHandler handler, DependentList <TGIBlock> ParentTGIBlocks = null)
     : base(handler)
 {
     this.ParentTGIBlocks = ParentTGIBlocks;
     ageGender            = new AgeGenderFlags(handler);
 }
예제 #9
0
        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);
        }