Exemplo n.º 1
0
        protected virtual void Parse(Stream s)
        {
            BinaryReader r = new BinaryReader(s);

            this.version         = r.ReadUInt32();
            this.catalogVersion  = r.ReadUInt32();
            this.catalogNameHash = r.ReadUInt32();
            this.catalogDescHash = r.ReadUInt32();
            this.catalogPrice    = r.ReadUInt32();

            this.catalogUnknown1 = r.ReadUInt32();
            this.catalogUnknown2 = r.ReadUInt32();
            this.catalogUnknown3 = r.ReadUInt32();
            byte count = r.ReadByte();

            TGIBlock[] tgiLIst = new TGIBlock[count];
            for (int i = 0; i < count; i++)
            {
                tgiLIst[i] = new TGIBlock(RecommendedApiVersion, OnResourceChanged, "ITG", s);
            }
            this.catalogStyleTGIList = new CountedTGIBlockList(OnResourceChanged, tgiLIst);

            this.catalogUnknown4 = r.ReadUInt16();
            var count2 = r.ReadInt32();

            this.catalogTagList = new SimpleList <ushort>(OnResourceChanged);
            for (var i = 0; i < count2; i++)
            {
                this.catalogTagList.Add(r.ReadUInt16());
            }
            this.catalogSellingPointList = new SellingPointList(OnResourceChanged, s);
            this.catalogUnknown5         = r.ReadUInt64();
            this.catalogUnknown6         = r.ReadUInt16();
            this.catalogUnknown7         = r.ReadUInt64();
        }
Exemplo n.º 2
0
 protected override Stream UnParse()
 {
     var s = base.UnParse();
     BinaryWriter w = new BinaryWriter(s);
     if (this.modlList == null)
     {                                           
         TGIBlock[] tgiList = new TGIBlock[8];
         for (int i = 0; i < 8; i++) tgiList[i] = new TGIBlock(RecommendedApiVersion, OnResourceChanged, "ITG");
         this.modlList = new CountedTGIBlockList(OnResourceChanged, tgiList);
     }
     foreach (var tgi in this.modlList)
     {
         // There is a bug in Peter's code.
         // The TGIBlcok being copied for several times and the TGI order got lost
         w.Write(tgi.Instance);
         w.Write(tgi.ResourceType);
         w.Write(tgi.ResourceGroup);
     }
     w.Write(this.unknown1);
     w.Write(this.unknown2);
     w.Write(this.unknown3);
     if (colorList == null) this.colorList = new SwatchColorList(OnResourceChanged);
     this.colorList.UnParse(s);
     return s;
 }
Exemplo n.º 3
0
            public void Parse(Stream s)
            {
                BinaryReader r = new BinaryReader(s);

                this.contexVersion     = r.ReadUInt32();
                this.publicKeyCount    = r.ReadUInt32();
                this.externalKeyCount  = r.ReadUInt32();
                this.delayLoadKeyCount = r.ReadUInt32();
                this.objectKeyCount    = r.ReadUInt32();
                List <TGIBlock> tempList = new List <TGIBlock>();

                for (int i = 0; i < publicKeyCount; i++)
                {
                    tempList.Add(new TGIBlock(1, handler, "ITG", s));
                }
                this.publicKey = new CountedTGIBlockList(null, tempList);
                tempList.Clear();
                for (int i = 0; i < externalKeyCount; i++)
                {
                    tempList.Add(new TGIBlock(1, handler, "ITG", s));
                }
                this.externalKey = new CountedTGIBlockList(null, tempList);
                tempList.Clear();
                for (int i = 0; i < delayLoadKeyCount; i++)
                {
                    tempList.Add(new TGIBlock(1, handler, "ITG", s));
                }
                this.delayLoadKey = new CountedTGIBlockList(null, tempList);
                this.objectKey    = new ObjectDataLIst(handler, s, objectKeyCount);
            }
Exemplo n.º 4
0
        protected override Stream UnParse()
        {
            var          s = base.UnParse();
            BinaryWriter w = new BinaryWriter(s);

            if (this.modlList == null)
            {
                TGIBlock[] tgiList = new TGIBlock[8];
                for (int i = 0; i < 8; i++)
                {
                    tgiList[i] = new TGIBlock(RecommendedApiVersion, OnResourceChanged, "ITG");
                }
                this.modlList = new CountedTGIBlockList(OnResourceChanged, tgiList);
            }
            foreach (var tgi in this.modlList)
            {
                // There is a bug in Peter's code.
                // The TGIBlcok being copied for several times and the TGI order got lost
                w.Write(tgi.Instance);
                w.Write(tgi.ResourceType);
                w.Write(tgi.ResourceGroup);
            }
            w.Write(this.unknown1);
            w.Write(this.unknown2);
            w.Write(this.unknown3);
            if (colorList == null)
            {
                this.colorList = new SwatchColorList(OnResourceChanged);
            }
            this.colorList.UnParse(s);
            return(s);
        }
Exemplo n.º 5
0
        protected override Stream UnParse()
        {
            var s  = new MemoryStream();
            var bw = new BinaryWriter(s);

            bw.Write(this.version);
            if (this.commonA == null)
            {
                commonA = new CatalogCommon(kRecommendedApiVersion, this.OnResourceChanged);
            }
            this.commonA.UnParse(s);
            bw.Write(this.hashIndicator);
            bw.Write(this.hash01);
            bw.Write(this.hash02);
            bw.Write(this.hash03);
            if (this.matdList == null)
            {
                this.matdList = new CountedTGIBlockList(this.OnResourceChanged, TGIBlock.Order.ITG);
            }
            bw.Write(Convert.ToUInt32(matdList.Count));
            this.matdList.UnParse(s);
            if (this.colors == null)
            {
                this.colors = new ColorList(this.OnResourceChanged);
            }
            this.colors.UnParse(s);
            bw.Write(this.unk02);
            bw.Write(this.unkIID01);
            return(s);
        }
Exemplo n.º 6
0
        /// <summary>
        /// Return a <see cref="Stream"/> containing the data in this GenericRCOLResource instance.
        /// </summary>
        /// <returns>A <see cref="Stream"/> containing the data in this GenericRCOLResource instance.</returns>
        protected override Stream UnParse()
        {
            long rcolIndexPos;

            MemoryStream ms = new MemoryStream();
            BinaryWriter w  = new BinaryWriter(ms);

            w.Write(version);
            w.Write(publicChunks);
            w.Write(unused);
            if (resources == null)
            {
                resources = new CountedTGIBlockList(OnResourceChanged, "ITG");
            }
            w.Write(resources.Count);
            if (blockList == null)
            {
                blockList = new ChunkEntryList(OnResourceChanged)
                {
                    ParentTGIBlocks = resources,
                }
            }
            ;
            w.Write(blockList.Count);
            foreach (ChunkEntry ce in blockList)
            {
                ce.TGIBlock.UnParse(ms);
            }
            resources.UnParse(ms);

            rcolIndexPos = ms.Position;
            RCOLIndexEntry[] index = new RCOLIndexEntry[blockList.Count];
            for (int i = 0; i < blockList.Count; i++)
            {
                w.Write((uint)0); w.Write((uint)0);
            }                                                                                 // Pad for the index

            int j = 0;

            foreach (ChunkEntry ce in blockList)
            {
                byte[] data = ce.RCOLBlock.AsBytes;
                while (w.BaseStream.Position % 4 != 0)
                {
                    w.Write((byte)0);
                }
                index[j].Position = (uint)ms.Position;
                index[j].Length   = data.Length;
                w.Write(data);
                j++;
            }

            ms.Position = rcolIndexPos;
            foreach (RCOLIndexEntry entry in index)
            {
                w.Write(entry.Position); w.Write(entry.Length);
            }

            return(ms);
        }
            protected void Parse(Stream s, CountedTGIBlockList tgiList)
            {
                BinaryReader r = new BinaryReader(s);

                this.blockIndex           = r.ReadByte();
                this.unknown1             = r.ReadUInt32();
                this.unknownReferenceList = new UnknownReferenceList(handler, s, tgiList);
            }
            protected void Parse(Stream s, CountedTGIBlockList tgiList)
            {
                int count = s.ReadByte();

                for (int i = 0; i < count; i++)
                {
                    this.Add(new SliderReference(recommendedApiVersion, handler, s, this.tgiList));
                }
            }
            protected void Parse(Stream s, CountedTGIBlockList tgiList)
            {
                BinaryReader r     = new BinaryReader(s);
                int          count = r.ReadInt32();

                for (int i = 0; i < count; i++)
                {
                    this.Add(new UnknownReference(recommendedApiVersion, handler, s, this.tgiList));
                }
            }
Exemplo n.º 10
0
        void saveVPXY()
        {
            rcol.ResourceChanged -= new EventHandler(rcol_ResourceChanged);
            try
            {
                ClearLinkedPartsTLP(true);
                CountedTGIBlockList ltgib = new CountedTGIBlockList(null);
                vpxy.Entries.Clear();
                int  count   = 0;
                byte count00 = 1;
                for (int row = 1; row < tlpParts.RowCount - 1; row++)
                {
                    TGIBlockCombo c = tlpParts.GetControlFromPosition(2, row) as TGIBlockCombo;
                    if (ltbc.IndexOf(c) < 0)
                    {
                        continue;
                    }
                    if (c.SelectedIndex < 0)
                    {
                        continue;
                    }
                    ltgib.Add(vpxy.TGIBlocks[c.SelectedIndex]);
                    vpxy.Entries.Add(new VPXY.Entry01(0, null, 1, count++));
                    if (c.Tag != null)
                    {
                        VPXY.Entry00 e00 = c.Tag as VPXY.Entry00;
                        if (e00.TGIIndexes.Count <= 0)
                        {
                            continue;
                        }
                        e00.EntryID = count00++;
                        e00.TGIIndexes.ForEach(elem =>
                        {
                            ltgib.Add(vpxy.TGIBlocks[elem]);
                            elem = count++;
                        });
                        if (e00.TGIIndexes.Count > 0)
                        {
                            vpxy.Entries.Add(e00);
                        }
                    }
                }
                if (vpxy.Modular)
                {
                    ltgib.Add(vpxy.TGIBlocks[tbcFTPT.SelectedIndex]);
                    vpxy.FTPTIndex = count++;
                }

                vpxy.TGIBlocks.Clear();
                vpxy.TGIBlocks.AddRange(ltgib);

                result = (byte[])rcol.AsBytes.Clone();
            }
            finally { rcol.ResourceChanged -= new EventHandler(rcol_ResourceChanged); }
        }
Exemplo n.º 11
0
        private void btnTGIEditor_Click(object sender, EventArgs e)
        {
            CountedTGIBlockList tgiBlocksCopy = new CountedTGIBlockList(null, vpxy.TGIBlocks);
            DialogResult        dr            = TGIBlockListEditor.Show(tgiBlocksCopy);

            if (dr != DialogResult.OK)
            {
                return;
            }
            vpxy.TGIBlocks.Clear();
            vpxy.TGIBlocks.AddRange(tgiBlocksCopy.ToArray());
        }
Exemplo n.º 12
0
 protected override void Parse(Stream s)
 {
     BinaryReader r = new BinaryReader(s);
     base.Parse(s);
     TGIBlock[] tgiList = new TGIBlock[8];
     for (int i = 0; i < 8; i++) tgiList[i] = new TGIBlock(RecommendedApiVersion, OnResourceChanged, "ITG", s);
     this.modlList = new CountedTGIBlockList(OnResourceChanged, "ITG", tgiList);
     this.unknown1 = r.ReadUInt32();
     this.unknown2 = r.ReadUInt64();
     this.unknown3 = r.ReadUInt32();
     if (this.colorList == null) this.colorList = new SwatchColorList(OnResourceChanged);
     this.colorList = new SwatchColorList(OnResourceChanged, s);
 }
Exemplo n.º 13
0
        void Parse(Stream s)
        {
            var br = new BinaryReader(s);

            this.version       = br.ReadUInt32();
            this.commonBlock   = new CatalogCommon(kRecommendedApiVersion, this.OnResourceChanged, s);
            this.hashIndicator = br.ReadUInt32();
            this.hash01        = br.ReadUInt32();
            this.hash02        = br.ReadUInt32();
            this.hash03        = br.ReadUInt32();
            int count = Convert.ToUInt16(br.ReadUInt32());

            this.matdList = new CountedTGIBlockList(this.OnResourceChanged, TGIBlock.Order.ITG, count, s);
        }
Exemplo n.º 14
0
        private void btnTGIBlockListEditor_Click(object sender, EventArgs e)
        {
            CountedTGIBlockList tgiBlocksCopy = new CountedTGIBlockList(null, tgiBlocks);
            DialogResult dr = TGIBlockListEditor.Show(tgiBlocksCopy);
            if (dr != DialogResult.OK) return;

            TGIBlock tgib = tgiBlocks == null ? null : cbTGIBlocks.SelectedIndex >= 0 && cbTGIBlocks.SelectedIndex < tgiBlocks.Count ? tgiBlocks[cbTGIBlocks.SelectedIndex] : null;
            string selectedItem = tgib == null ? "(null)" : MakeItem(tgib);
            tgiBlocks.Clear();
            tgiBlocks.AddRange(tgiBlocksCopy.ToArray());

            FillList(selectedItem);

            OnTGIBlockListChanged(this, EventArgs.Empty);
        }
Exemplo n.º 15
0
        protected override Stream UnParse()
        {
            if (version == 0 && publicChunks == 0 && unused == 0 && blockList == null && resources == null)
            {
                // In that case, assume we're a newly created "stream == null" situation GenericRCOLResource that needs
                // some help to become a real life GeometryResource.

                resources = new CountedTGIBlockList(OnResourceChanged, "ITG");
                // Unfortunately, a Resource does not know its own ResourceKey.  This is the best we can manage.
                TGIBlock rk = new TGIBlock(0, null, 0x015A1849, 0, 0);
                GEOM geom = new GEOM(requestedApiVersion, OnResourceChanged);
                blockList = new ChunkEntryList(OnResourceChanged, new ChunkEntry[] { new ChunkEntry(0, OnResourceChanged, rk, geom), }) { ParentTGIBlocks = Resources, };
            }
            return base.UnParse();
        }
Exemplo n.º 16
0
        private void btnTGIBlockListEditor_Click(object sender, EventArgs e)
        {
            CountedTGIBlockList tgiBlocksCopy = new CountedTGIBlockList(null, tgiBlocks);
            DialogResult dr = TGIBlockListEditor.Show(tgiBlocksCopy);
            if (dr != DialogResult.OK) return;

            TGIBlock tgib = tgiBlocks == null ? null : cbTGIBlocks.SelectedIndex >= 0 && cbTGIBlocks.SelectedIndex < tgiBlocks.Count ? tgiBlocks[cbTGIBlocks.SelectedIndex] : null;
            string selectedItem = tgib == null ? "(null)" : MakeItem(tgib);
            tgiBlocks.Clear();
            tgiBlocks.AddRange(tgiBlocksCopy.ToArray());

            FillList(selectedItem);

            OnTGIBlockListChanged(this, EventArgs.Empty);
        }
Exemplo n.º 17
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(0, 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 (checking)
            {
                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;
        }
Exemplo n.º 18
0
        protected override Stream UnParse()
        {
            if (version == 0 && publicChunks == 0 && unused == 0 && blockList == null && resources == null)
            {
                // In that case, assume we're a newly created "stream == null" situation GenericRCOLResource that needs
                // some help to become a real life GeometryResource.

                resources = new CountedTGIBlockList(OnResourceChanged, "ITG");
                // Unfortunately, a Resource does not know its own ResourceKey.  This is the best we can manage.
                TGIBlock rk   = new TGIBlock(null, 0x015A1849, 0, 0);
                GEOM     geom = new GEOM(OnResourceChanged);
                blockList = new ChunkEntryList(OnResourceChanged, new[] { new ChunkEntry(OnResourceChanged, rk, geom), })
                {
                    ParentTGIBlocks = Resources,
                };
            }
            return(base.UnParse());
        }
Exemplo n.º 19
0
        protected override Stream UnParse()
        {
            MemoryStream ms = new MemoryStream();
            BinaryWriter w  = new BinaryWriter(ms);

            w.Write(this.version);
            w.Write(this.catalogVersion);
            w.Write(this.catalogNameHash);
            w.Write(this.catalogDescHash);
            w.Write(this.catalogPrice);
            w.Write(this.catalogUnknown1);
            w.Write(this.catalogUnknown2);
            w.Write(this.catalogUnknown3);
            if (this.catalogStyleTGIList == null)
            {
                this.catalogStyleTGIList = new CountedTGIBlockList(OnResourceChanged);
            }
            w.Write((byte)this.catalogStyleTGIList.Count);
            foreach (var tgi in this.catalogStyleTGIList)
            {
                tgi.UnParse(ms);
            }

            w.Write(this.catalogUnknown4);
            if (this.catalogTagList == null)
            {
                this.catalogTagList = new SimpleList <ushort>(OnResourceChanged);
            }
            w.Write(this.catalogTagList.Count);
            foreach (var i in this.catalogTagList)
            {
                w.Write(i);
            }
            if (this.catalogSellingPointList == null)
            {
                this.catalogSellingPointList = new SellingPointList(OnResourceChanged);
            }
            this.catalogSellingPointList.UnParse(ms);
            w.Write(this.catalogUnknown5);
            w.Write(this.catalogUnknown6);
            w.Write(this.catalogUnknown7);
            return(ms);
        }
Exemplo n.º 20
0
        protected override Stream UnParse()
        {
            MemoryStream ms = new MemoryStream();
            BinaryWriter w  = new BinaryWriter(ms);

            w.Write(this.version);
            w.Write(this.catalogVersion);
            w.Write(this.catalogNameHash);
            w.Write(this.catalogDescHash);
            w.Write(this.catalogPrice);
            w.Write(this.catalogUnknown1);
            w.Write(this.catalogUnknown2);
            w.Write(this.catalogUnknown3);
            if (this.catalogStyleTGIList == null)
            {
                this.catalogStyleTGIList = new CountedTGIBlockList(OnResourceChanged);
            }
            w.Write((byte)this.catalogStyleTGIList.Count);
            foreach (var tgi in this.catalogStyleTGIList) /* bug in peter's code. Dirty fix*/ w {
Exemplo n.º 21
0
            public void UnParse(Stream s)
            {
                BinaryWriter w = new BinaryWriter(s);

                w.Write(this.contexVersion);
                if (this.publicKey == null)
                {
                    this.publicKey = new CountedTGIBlockList(handler);
                }
                w.Write(this.publicKey.Count);
                if (this.externalKey == null)
                {
                    this.externalKey = new CountedTGIBlockList(handler);
                }
                w.Write(this.externalKey.Count);
                if (this.delayLoadKey == null)
                {
                    this.delayLoadKey = new CountedTGIBlockList(handler);
                }
                w.Write(this.delayLoadKey.Count);
                if (this.objectKey == null)
                {
                    this.objectKey = new ObjectDataLIst(handler);
                }
                w.Write(this.objectKey.Count);
                foreach (var tgi in this.publicKey)
                {
                    tgi.UnParse(s);
                }
                foreach (var tgi in this.externalKey)
                {
                    tgi.UnParse(s);
                }
                foreach (var tgi in this.delayLoadKey)
                {
                    tgi.UnParse(s);
                }
                foreach (var obj in this.objectKey)
                {
                    obj.UnParse(s);
                }
            }
Exemplo n.º 22
0
        protected override void Parse(Stream s)
        {
            BinaryReader r = new BinaryReader(s);

            base.Parse(s);
            TGIBlock[] tgiList = new TGIBlock[8];
            for (int i = 0; i < 8; i++)
            {
                tgiList[i] = new TGIBlock(RecommendedApiVersion, OnResourceChanged, "ITG", s);
            }
            this.modlList = new CountedTGIBlockList(OnResourceChanged, "ITG", tgiList);
            this.unknown1 = r.ReadUInt32();
            this.unknown2 = r.ReadUInt64();
            this.unknown3 = r.ReadUInt32();
            if (this.colorList == null)
            {
                this.colorList = new SwatchColorList(OnResourceChanged);
            }
            this.colorList = new SwatchColorList(OnResourceChanged, s);
        }
Exemplo n.º 23
0
        public void MakeNew()
        {
            this.commonBlockVersion = 0x9;
            this.nameHash           = 0;
            this.descriptionHash    = 0;
            this.price       = 0;
            this.unkCommon01 = 0;
            this.unkCommon02 = 0;
            this.unkCommon03 = 0;
            int tgi_count = 0;

            this.productStyles  = new CountedTGIBlockList(handler, TGIBlock.Order.ITG, tgi_count);
            this.unkCommon04    = 0;
            this.tagList        = new CatalogTagList(handler);
            this.sellingPoints  = new SellingPointList(handler);
            this.unlockByHash   = 0;
            this.unlockedByHash = 0;
            this.unkCommon06    = 0xffff;
            this.unkCommon07    = 0;
        }
Exemplo n.º 24
0
        void Parse(Stream s)
        {
            var br = new BinaryReader(s);

            this.commonBlockVersion = br.ReadUInt32();
            this.nameHash           = br.ReadUInt32();
            this.descriptionHash    = br.ReadUInt32();
            this.price       = br.ReadUInt32();
            this.unkCommon01 = br.ReadUInt32();
            this.unkCommon02 = br.ReadUInt32();
            this.unkCommon03 = br.ReadUInt32();
            int tgi_count = br.ReadByte();

            this.productStyles  = new CountedTGIBlockList(handler, TGIBlock.Order.ITG, tgi_count, s);
            this.unkCommon04    = br.ReadUInt16();
            this.tagList        = new CatalogTagList(handler, s);
            this.sellingPoints  = new SellingPointList(handler, s);
            this.unlockByHash   = br.ReadUInt32();
            this.unlockedByHash = br.ReadUInt32();
            this.unkCommon06    = br.ReadUInt16();
            this.unkCommon07    = br.ReadUInt64();
        }
Exemplo n.º 25
0
 public CatalogCommon(int APIversion, EventHandler handler, uint commonBlockVersion, uint nameHash, uint descriptionHash,
                      uint price, uint unkCommon01, uint unkCommon02, uint unkCommon03, CountedTGIBlockList productStyles, UInt16 unkCommon04,
                      CatalogTagList tagList, SellingPointList sellingPoints, uint unlockByHash, uint unlockedByHash, UInt16 unkCommon06, ulong unkCommon07)
     : base(APIversion, handler)
 {
     this.handler            = handler;
     this.commonBlockVersion = commonBlockVersion;
     this.nameHash           = nameHash;
     this.descriptionHash    = descriptionHash;
     this.price          = price;
     this.unkCommon01    = unkCommon01;
     this.unkCommon02    = unkCommon02;
     this.unkCommon03    = unkCommon03;
     this.productStyles  = new CountedTGIBlockList(handler, TGIBlock.Order.ITG, productStyles);
     this.unkCommon04    = unkCommon04;
     this.tagList        = new CatalogTagList(handler, tagList);
     this.sellingPoints  = new SellingPointList(handler, sellingPoints);
     this.unlockByHash   = unlockByHash;
     this.unlockedByHash = unlockedByHash;
     this.unkCommon06    = unkCommon06;
     this.unkCommon07    = unkCommon07;
 }
Exemplo n.º 26
0
        void Parse(Stream s)
        {
            BinaryReader r = new BinaryReader(s);

            version      = r.ReadUInt32();
            publicChunks = r.ReadInt32();
            unused       = r.ReadUInt32();
            int countResources = r.ReadInt32();
            int countChunks    = r.ReadInt32();

            TGIBlock[] chunks = new TGIBlock[countChunks];
            for (int i = 0; i < countChunks; i++)
            {
                chunks[i] = new TGIBlock(0, OnResourceChanged, "ITG", s);
            }
            resources = new CountedTGIBlockList(OnResourceChanged, "ITG", countResources, s);

            RCOLIndexEntry[] index = new RCOLIndexEntry[countChunks];
            for (int i = 0; i < countChunks; i++)
            {
                index[i].Position = r.ReadUInt32(); index[i].Length = r.ReadInt32();
            }
            if (countChunks == 1)
            {
                index[0].Position = 0x2c + (uint)countResources * 16;
                index[0].Length   = (int)(s.Length - index[0].Position);
                if (chunks[0].ResourceType == 0)
                {
                    string tag = new string(r.ReadChars(4));
                    chunks[0].ResourceType = GenericRCOLResourceHandler.RCOLTypesForTag(tag).FirstOrDefault();
                }
            }

            blockList = new ChunkEntryList(requestedApiVersion, OnResourceChanged, s, chunks, index)
            {
                ParentTGIBlocks = resources,
            };
        }
Exemplo n.º 27
0
        public static TxtcResource.TxtcResource TattooTxtc(TGIBlock tatTGI)
        {
            TxtcResource.TxtcResource txtc = new TxtcResource.TxtcResource(0, null);
            txtc.Root.Version  = 8;
            txtc.Root.DataType = TxtcResource.TxtcResource.DataTypeFlags.Body;

            TxtcResource.TxtcResource.EntryBlockList entryBlockList = new TxtcResource.TxtcResource.EntryBlockList(null);

            TxtcResource.TxtcResource.EntryList entryList0 = new TxtcResource.TxtcResource.EntryList(null);
            entryList0.Add(new TxtcResource.TxtcResource.EntryUInt32(0, null, TxtcResource.TxtcResource.EntryUInt32.UInt32Properties.ID, 0, (uint)TxtcResource.TxtcResource.EntryUInt32.StepType.SetTarget));
            entryList0.Add(new TxtcResource.TxtcResource.EntryBoolean(0, null, TxtcResource.TxtcResource.EntryBoolean.BooleanProperties.UIVisible, 0, 0));
            entryList0.Add(new TxtcResource.TxtcResource.EntryInt32(0, null, TxtcResource.TxtcResource.EntryInt32.Int32Properties.MinShaderModel, 0, 0));
            entryList0.Add(new TxtcResource.TxtcResource.EntryInt32(0, null, TxtcResource.TxtcResource.EntryInt32.Int32Properties.SkipShaderModel, 0, (int)TxtcResource.TxtcResource.EntryInt32.ShaderModel.SM_Highest));
            entryList0.Add(new TxtcResource.TxtcResource.EntryUInt32(0, null, TxtcResource.TxtcResource.EntryUInt32.UInt32Properties.MinDetailLevel, 0, 0xFFFFFFFF));
            entryList0.Add(new TxtcResource.TxtcResource.EntryUInt32(0, null, TxtcResource.TxtcResource.EntryUInt32.UInt32Properties.SkipDetailLevel, 0, (uint)TxtcResource.TxtcResource.EntryUInt32.DetailLevel.Lowest));
            entryList0.Add(new TxtcResource.TxtcResource.EntryString(0, null, TxtcResource.TxtcResource.EntryString.StringProperties.Description, 0, "Texture Step"));
            entryList0.Add(new TxtcResource.TxtcResource.EntryUInt32(0, null, TxtcResource.TxtcResource.EntryUInt32.UInt32Properties.RenderTarget, 0, (uint)TxtcResource.TxtcResource.EntryUInt32.RenderTarget.RenderTarget_B));
            TxtcResource.TxtcResource.EntryBlock entBlock0 = new TxtcResource.TxtcResource.EntryBlock(0, null);
            entBlock0.Entries = entryList0;
            entryBlockList.Add(entBlock0);

            TxtcResource.TxtcResource.EntryList entryList1 = new TxtcResource.TxtcResource.EntryList(null);
            entryList1.Add(new TxtcResource.TxtcResource.EntryUInt32(0, null, TxtcResource.TxtcResource.EntryUInt32.UInt32Properties.ID, 0, (uint)TxtcResource.TxtcResource.EntryUInt32.StepType.ColorFill));
            entryList1.Add(new TxtcResource.TxtcResource.EntryBoolean(0, null, TxtcResource.TxtcResource.EntryBoolean.BooleanProperties.UIVisible, 0, 0));
            entryList1.Add(new TxtcResource.TxtcResource.EntryInt32(0, null, TxtcResource.TxtcResource.EntryInt32.Int32Properties.MinShaderModel, 0, 0));
            entryList1.Add(new TxtcResource.TxtcResource.EntryInt32(0, null, TxtcResource.TxtcResource.EntryInt32.Int32Properties.SkipShaderModel, 0, (int)TxtcResource.TxtcResource.EntryInt32.ShaderModel.SM_Highest));
            entryList1.Add(new TxtcResource.TxtcResource.EntryUInt32(0, null, TxtcResource.TxtcResource.EntryUInt32.UInt32Properties.MinDetailLevel, 0, 0xFFFFFFFF));
            entryList1.Add(new TxtcResource.TxtcResource.EntryUInt32(0, null, TxtcResource.TxtcResource.EntryUInt32.UInt32Properties.SkipDetailLevel, 0, (uint)TxtcResource.TxtcResource.EntryUInt32.DetailLevel.Lowest));
            entryList1.Add(new TxtcResource.TxtcResource.EntryString(0, null, TxtcResource.TxtcResource.EntryString.StringProperties.Description, 0, "Texture Step"));
            entryList1.Add(new TxtcResource.TxtcResource.EntryInt32(0, null, TxtcResource.TxtcResource.EntryInt32.Int32Properties.ColorWrite, 0, (int)TxtcResource.TxtcResource.EntryInt32.ColorWriteChannels.Alpha +
                                                                    (int)TxtcResource.TxtcResource.EntryInt32.ColorWriteChannels.Blue + (int)TxtcResource.TxtcResource.EntryInt32.ColorWriteChannels.Green + (int)TxtcResource.TxtcResource.EntryInt32.ColorWriteChannels.Red));
            entryList1.Add(new TxtcResource.TxtcResource.EntryRectangle(0, null, TxtcResource.TxtcResource.EntryRectangle.RectangleProperties.DestinationRectangle, 0, new float[] { 0.0f, 0.0f, 1.0f, 1.0f }));
            entryList1.Add(new TxtcResource.TxtcResource.EntryBoolean(0, null, TxtcResource.TxtcResource.EntryBoolean.BooleanProperties.EnableBlending, 0, 0));
            entryList1.Add(new TxtcResource.TxtcResource.EntryUInt32(0, null, TxtcResource.TxtcResource.EntryUInt32.UInt32Properties.Color, 0, 0));
            TxtcResource.TxtcResource.EntryBlock entBlock1 = new TxtcResource.TxtcResource.EntryBlock(0, null);
            entBlock1.Entries = entryList1;
            entryBlockList.Add(entBlock1);

            TxtcResource.TxtcResource.EntryList entryList2 = new TxtcResource.TxtcResource.EntryList(null);
            entryList2.Add(new TxtcResource.TxtcResource.EntryUInt32(0, null, TxtcResource.TxtcResource.EntryUInt32.UInt32Properties.ID, 0, (uint)TxtcResource.TxtcResource.EntryUInt32.StepType.ChannelSelect));
            entryList2.Add(new TxtcResource.TxtcResource.EntryBoolean(0, null, TxtcResource.TxtcResource.EntryBoolean.BooleanProperties.UIVisible, 0, 0));
            entryList2.Add(new TxtcResource.TxtcResource.EntryInt32(0, null, TxtcResource.TxtcResource.EntryInt32.Int32Properties.MinShaderModel, 0, 0));
            entryList2.Add(new TxtcResource.TxtcResource.EntryInt32(0, null, TxtcResource.TxtcResource.EntryInt32.Int32Properties.SkipShaderModel, 0, (int)TxtcResource.TxtcResource.EntryInt32.ShaderModel.SM_Highest));
            entryList2.Add(new TxtcResource.TxtcResource.EntryUInt32(0, null, TxtcResource.TxtcResource.EntryUInt32.UInt32Properties.MinDetailLevel, 0, 0xFFFFFFFF));
            entryList2.Add(new TxtcResource.TxtcResource.EntryUInt32(0, null, TxtcResource.TxtcResource.EntryUInt32.UInt32Properties.SkipDetailLevel, 0, (uint)TxtcResource.TxtcResource.EntryUInt32.DetailLevel.Lowest));
            entryList2.Add(new TxtcResource.TxtcResource.EntryString(0, null, TxtcResource.TxtcResource.EntryString.StringProperties.Description, 0, "Texture Step"));
            entryList2.Add(new TxtcResource.TxtcResource.EntryInt32(0, null, TxtcResource.TxtcResource.EntryInt32.Int32Properties.ColorWrite, 0, (int)TxtcResource.TxtcResource.EntryInt32.ColorWriteChannels.Alpha));
            entryList2.Add(new TxtcResource.TxtcResource.EntryRectangle(0, null, TxtcResource.TxtcResource.EntryRectangle.RectangleProperties.DestinationRectangle, 0, new float[] { 0.0f, 0.0f, 1.0f, 1.0f }));
            entryList2.Add(new TxtcResource.TxtcResource.EntryBoolean(0, null, TxtcResource.TxtcResource.EntryBoolean.BooleanProperties.EnableBlending, 0, 0));
            entryList2.Add(new TxtcResource.TxtcResource.EntrySingle(0, null, TxtcResource.TxtcResource.EntrySingle.SingleProperties.Rotation, 0, 0.0f));
            entryList2.Add(new TxtcResource.TxtcResource.EntryRectangle(0, null, TxtcResource.TxtcResource.EntryRectangle.RectangleProperties.SourceRectangle, 0, new float[] { 0.0f, 0.0f, 1.0f, 1.0f }));
            entryList2.Add(new TxtcResource.TxtcResource.EntryBoolean(0, null, TxtcResource.TxtcResource.EntryBoolean.BooleanProperties.EnableFiltering, 0, 1));
            entryList2.Add(new TxtcResource.TxtcResource.EntryTGIIndex(0, null, TxtcResource.TxtcResource.EntryTGIIndex.TGIIndexProperties.ImageKey, 0, 0));
            entryList2.Add(new TxtcResource.TxtcResource.EntryVector(0, null, TxtcResource.TxtcResource.EntryVector.VectorProperties.ChannelSelect, 0, new float[] { 1.0f, 0.0f, 0.0f, 0.0f }));
            TxtcResource.TxtcResource.EntryBlock entBlock2 = new TxtcResource.TxtcResource.EntryBlock(0, null);
            entBlock2.Entries = entryList2;
            entryBlockList.Add(entBlock2);

            TxtcResource.TxtcResource.EntryList entryList3 = new TxtcResource.TxtcResource.EntryList(null);
            entryList3.Add(new TxtcResource.TxtcResource.EntryUInt32(0, null, TxtcResource.TxtcResource.EntryUInt32.UInt32Properties.ID, 0, (uint)TxtcResource.TxtcResource.EntryUInt32.StepType.ColorFill));
            entryList3.Add(new TxtcResource.TxtcResource.EntryBoolean(0, null, TxtcResource.TxtcResource.EntryBoolean.BooleanProperties.UIVisible, 0, 0));
            entryList3.Add(new TxtcResource.TxtcResource.EntryInt32(0, null, TxtcResource.TxtcResource.EntryInt32.Int32Properties.MinShaderModel, 0, 0));
            entryList3.Add(new TxtcResource.TxtcResource.EntryInt32(0, null, TxtcResource.TxtcResource.EntryInt32.Int32Properties.SkipShaderModel, 0, (int)TxtcResource.TxtcResource.EntryInt32.ShaderModel.SM_Highest));
            entryList3.Add(new TxtcResource.TxtcResource.EntryUInt32(0, null, TxtcResource.TxtcResource.EntryUInt32.UInt32Properties.MinDetailLevel, 0, 0xFFFFFFFF));
            entryList3.Add(new TxtcResource.TxtcResource.EntryUInt32(0, null, TxtcResource.TxtcResource.EntryUInt32.UInt32Properties.SkipDetailLevel, 0, (uint)TxtcResource.TxtcResource.EntryUInt32.DetailLevel.Lowest));
            entryList3.Add(new TxtcResource.TxtcResource.EntryString(0, null, TxtcResource.TxtcResource.EntryString.StringProperties.Description, 0, "Texture Step"));
            entryList3.Add(new TxtcResource.TxtcResource.EntryInt32(0, null, TxtcResource.TxtcResource.EntryInt32.Int32Properties.ColorWrite, 0,
                                                                    (int)TxtcResource.TxtcResource.EntryInt32.ColorWriteChannels.Blue + (int)TxtcResource.TxtcResource.EntryInt32.ColorWriteChannels.Green + (int)TxtcResource.TxtcResource.EntryInt32.ColorWriteChannels.Red));
            entryList3.Add(new TxtcResource.TxtcResource.EntryRectangle(0, null, TxtcResource.TxtcResource.EntryRectangle.RectangleProperties.DestinationRectangle, 0, new float[] { 0.0f, 0.0f, 1.0f, 1.0f }));
            entryList3.Add(new TxtcResource.TxtcResource.EntryBoolean(0, null, TxtcResource.TxtcResource.EntryBoolean.BooleanProperties.EnableBlending, 0, 1));
            entryList3.Add(new TxtcResource.TxtcResource.EntryInt32(0, null, TxtcResource.TxtcResource.EntryInt32.Int32Properties.SourceBlend, 0, (int)TxtcResource.TxtcResource.EntryInt32.Blend.DestinationAlpha));
            entryList3.Add(new TxtcResource.TxtcResource.EntryInt32(0, null, TxtcResource.TxtcResource.EntryInt32.Int32Properties.DestinationBlend, 0, (int)TxtcResource.TxtcResource.EntryInt32.Blend.InverseDestinationAlpha));
            entryList3.Add(new TxtcResource.TxtcResource.EntryUInt32(0, null, TxtcResource.TxtcResource.EntryUInt32.UInt32Properties.Color, 0, 0xFFED88F7));
            TxtcResource.TxtcResource.EntryBlock entBlock3 = new TxtcResource.TxtcResource.EntryBlock(0, null);
            entBlock3.Entries = entryList3;
            entryBlockList.Add(entBlock3);

            TxtcResource.TxtcResource.EntryList entryList4 = new TxtcResource.TxtcResource.EntryList(null);
            entryList4.Add(new TxtcResource.TxtcResource.EntryUInt32(0, null, TxtcResource.TxtcResource.EntryUInt32.UInt32Properties.ID, 0, (uint)TxtcResource.TxtcResource.EntryUInt32.StepType.ChannelSelect));
            entryList4.Add(new TxtcResource.TxtcResource.EntryBoolean(0, null, TxtcResource.TxtcResource.EntryBoolean.BooleanProperties.UIVisible, 0, 0));
            entryList4.Add(new TxtcResource.TxtcResource.EntryInt32(0, null, TxtcResource.TxtcResource.EntryInt32.Int32Properties.MinShaderModel, 0, 0));
            entryList4.Add(new TxtcResource.TxtcResource.EntryInt32(0, null, TxtcResource.TxtcResource.EntryInt32.Int32Properties.SkipShaderModel, 0, (int)TxtcResource.TxtcResource.EntryInt32.ShaderModel.SM_Highest));
            entryList4.Add(new TxtcResource.TxtcResource.EntryUInt32(0, null, TxtcResource.TxtcResource.EntryUInt32.UInt32Properties.MinDetailLevel, 0, 0xFFFFFFFF));
            entryList4.Add(new TxtcResource.TxtcResource.EntryUInt32(0, null, TxtcResource.TxtcResource.EntryUInt32.UInt32Properties.SkipDetailLevel, 0, (uint)TxtcResource.TxtcResource.EntryUInt32.DetailLevel.Lowest));
            entryList4.Add(new TxtcResource.TxtcResource.EntryString(0, null, TxtcResource.TxtcResource.EntryString.StringProperties.Description, 0, "Texture Step"));
            entryList4.Add(new TxtcResource.TxtcResource.EntryInt32(0, null, TxtcResource.TxtcResource.EntryInt32.Int32Properties.ColorWrite, 0, (int)TxtcResource.TxtcResource.EntryInt32.ColorWriteChannels.Alpha));
            entryList4.Add(new TxtcResource.TxtcResource.EntryRectangle(0, null, TxtcResource.TxtcResource.EntryRectangle.RectangleProperties.DestinationRectangle, 0, new float[] { 0.0f, 0.0f, 1.0f, 1.0f }));
            entryList4.Add(new TxtcResource.TxtcResource.EntryBoolean(0, null, TxtcResource.TxtcResource.EntryBoolean.BooleanProperties.EnableBlending, 0, 0));
            entryList4.Add(new TxtcResource.TxtcResource.EntrySingle(0, null, TxtcResource.TxtcResource.EntrySingle.SingleProperties.Rotation, 0, 0.0f));
            entryList4.Add(new TxtcResource.TxtcResource.EntryRectangle(0, null, TxtcResource.TxtcResource.EntryRectangle.RectangleProperties.SourceRectangle, 0, new float[] { 0.0f, 0.0f, 1.0f, 1.0f }));
            entryList4.Add(new TxtcResource.TxtcResource.EntryBoolean(0, null, TxtcResource.TxtcResource.EntryBoolean.BooleanProperties.EnableFiltering, 0, 1));
            entryList4.Add(new TxtcResource.TxtcResource.EntryTGIIndex(0, null, TxtcResource.TxtcResource.EntryTGIIndex.TGIIndexProperties.ImageKey, 0, 0));
            entryList4.Add(new TxtcResource.TxtcResource.EntryVector(0, null, TxtcResource.TxtcResource.EntryVector.VectorProperties.ChannelSelect, 0, new float[] { 0.0f, 1.0f, 0.0f, 0.0f }));
            TxtcResource.TxtcResource.EntryBlock entBlock4 = new TxtcResource.TxtcResource.EntryBlock(0, null);
            entBlock4.Entries = entryList4;
            entryBlockList.Add(entBlock4);

            TxtcResource.TxtcResource.EntryList entryList5 = new TxtcResource.TxtcResource.EntryList(null);
            entryList5.Add(new TxtcResource.TxtcResource.EntryUInt32(0, null, TxtcResource.TxtcResource.EntryUInt32.UInt32Properties.ID, 0, (uint)TxtcResource.TxtcResource.EntryUInt32.StepType.ColorFill));
            entryList5.Add(new TxtcResource.TxtcResource.EntryBoolean(0, null, TxtcResource.TxtcResource.EntryBoolean.BooleanProperties.UIVisible, 0, 0));
            entryList5.Add(new TxtcResource.TxtcResource.EntryInt32(0, null, TxtcResource.TxtcResource.EntryInt32.Int32Properties.MinShaderModel, 0, 0));
            entryList5.Add(new TxtcResource.TxtcResource.EntryInt32(0, null, TxtcResource.TxtcResource.EntryInt32.Int32Properties.SkipShaderModel, 0, (int)TxtcResource.TxtcResource.EntryInt32.ShaderModel.SM_Highest));
            entryList5.Add(new TxtcResource.TxtcResource.EntryUInt32(0, null, TxtcResource.TxtcResource.EntryUInt32.UInt32Properties.MinDetailLevel, 0, 0xFFFFFFFF));
            entryList5.Add(new TxtcResource.TxtcResource.EntryUInt32(0, null, TxtcResource.TxtcResource.EntryUInt32.UInt32Properties.SkipDetailLevel, 0, (uint)TxtcResource.TxtcResource.EntryUInt32.DetailLevel.Lowest));
            entryList5.Add(new TxtcResource.TxtcResource.EntryString(0, null, TxtcResource.TxtcResource.EntryString.StringProperties.Description, 0, "Texture Step"));
            entryList5.Add(new TxtcResource.TxtcResource.EntryInt32(0, null, TxtcResource.TxtcResource.EntryInt32.Int32Properties.ColorWrite, 0,
                                                                    (int)TxtcResource.TxtcResource.EntryInt32.ColorWriteChannels.Blue + (int)TxtcResource.TxtcResource.EntryInt32.ColorWriteChannels.Green + (int)TxtcResource.TxtcResource.EntryInt32.ColorWriteChannels.Red));
            entryList5.Add(new TxtcResource.TxtcResource.EntryRectangle(0, null, TxtcResource.TxtcResource.EntryRectangle.RectangleProperties.DestinationRectangle, 0, new float[] { 0.0f, 0.0f, 1.0f, 1.0f }));
            entryList5.Add(new TxtcResource.TxtcResource.EntryBoolean(0, null, TxtcResource.TxtcResource.EntryBoolean.BooleanProperties.EnableBlending, 0, 1));
            entryList5.Add(new TxtcResource.TxtcResource.EntryInt32(0, null, TxtcResource.TxtcResource.EntryInt32.Int32Properties.SourceBlend, 0, (int)TxtcResource.TxtcResource.EntryInt32.Blend.DestinationAlpha));
            entryList5.Add(new TxtcResource.TxtcResource.EntryInt32(0, null, TxtcResource.TxtcResource.EntryInt32.Int32Properties.DestinationBlend, 0, (int)TxtcResource.TxtcResource.EntryInt32.Blend.InverseDestinationAlpha));
            entryList5.Add(new TxtcResource.TxtcResource.EntryUInt32(0, null, TxtcResource.TxtcResource.EntryUInt32.UInt32Properties.Color, 0, 0xFF845DB7));
            TxtcResource.TxtcResource.EntryBlock entBlock5 = new TxtcResource.TxtcResource.EntryBlock(0, null);
            entBlock5.Entries = entryList5;
            entryBlockList.Add(entBlock5);

            TxtcResource.TxtcResource.EntryList entryList6 = new TxtcResource.TxtcResource.EntryList(null);
            entryList6.Add(new TxtcResource.TxtcResource.EntryUInt32(0, null, TxtcResource.TxtcResource.EntryUInt32.UInt32Properties.ID, 0, (uint)TxtcResource.TxtcResource.EntryUInt32.StepType.ChannelSelect));
            entryList6.Add(new TxtcResource.TxtcResource.EntryBoolean(0, null, TxtcResource.TxtcResource.EntryBoolean.BooleanProperties.UIVisible, 0, 0));
            entryList6.Add(new TxtcResource.TxtcResource.EntryInt32(0, null, TxtcResource.TxtcResource.EntryInt32.Int32Properties.MinShaderModel, 0, 0));
            entryList6.Add(new TxtcResource.TxtcResource.EntryInt32(0, null, TxtcResource.TxtcResource.EntryInt32.Int32Properties.SkipShaderModel, 0, (int)TxtcResource.TxtcResource.EntryInt32.ShaderModel.SM_Highest));
            entryList6.Add(new TxtcResource.TxtcResource.EntryUInt32(0, null, TxtcResource.TxtcResource.EntryUInt32.UInt32Properties.MinDetailLevel, 0, 0xFFFFFFFF));
            entryList6.Add(new TxtcResource.TxtcResource.EntryUInt32(0, null, TxtcResource.TxtcResource.EntryUInt32.UInt32Properties.SkipDetailLevel, 0, (uint)TxtcResource.TxtcResource.EntryUInt32.DetailLevel.Lowest));
            entryList6.Add(new TxtcResource.TxtcResource.EntryString(0, null, TxtcResource.TxtcResource.EntryString.StringProperties.Description, 0, "Texture Step"));
            entryList6.Add(new TxtcResource.TxtcResource.EntryInt32(0, null, TxtcResource.TxtcResource.EntryInt32.Int32Properties.ColorWrite, 0, (int)TxtcResource.TxtcResource.EntryInt32.ColorWriteChannels.Alpha));
            entryList6.Add(new TxtcResource.TxtcResource.EntryRectangle(0, null, TxtcResource.TxtcResource.EntryRectangle.RectangleProperties.DestinationRectangle, 0, new float[] { 0.0f, 0.0f, 1.0f, 1.0f }));
            entryList6.Add(new TxtcResource.TxtcResource.EntryBoolean(0, null, TxtcResource.TxtcResource.EntryBoolean.BooleanProperties.EnableBlending, 0, 0));
            entryList6.Add(new TxtcResource.TxtcResource.EntrySingle(0, null, TxtcResource.TxtcResource.EntrySingle.SingleProperties.Rotation, 0, 0.0f));
            entryList6.Add(new TxtcResource.TxtcResource.EntryRectangle(0, null, TxtcResource.TxtcResource.EntryRectangle.RectangleProperties.SourceRectangle, 0, new float[] { 0.0f, 0.0f, 1.0f, 1.0f }));
            entryList6.Add(new TxtcResource.TxtcResource.EntryBoolean(0, null, TxtcResource.TxtcResource.EntryBoolean.BooleanProperties.EnableFiltering, 0, 1));
            entryList6.Add(new TxtcResource.TxtcResource.EntryTGIIndex(0, null, TxtcResource.TxtcResource.EntryTGIIndex.TGIIndexProperties.ImageKey, 0, 0));
            entryList6.Add(new TxtcResource.TxtcResource.EntryVector(0, null, TxtcResource.TxtcResource.EntryVector.VectorProperties.ChannelSelect, 0, new float[] { 0.0f, 0.0f, 1.0f, 0.0f }));
            TxtcResource.TxtcResource.EntryBlock entBlock6 = new TxtcResource.TxtcResource.EntryBlock(0, null);
            entBlock6.Entries = entryList6;
            entryBlockList.Add(entBlock6);

            TxtcResource.TxtcResource.EntryList entryList7 = new TxtcResource.TxtcResource.EntryList(null);
            entryList7.Add(new TxtcResource.TxtcResource.EntryUInt32(0, null, TxtcResource.TxtcResource.EntryUInt32.UInt32Properties.ID, 0, (uint)TxtcResource.TxtcResource.EntryUInt32.StepType.ColorFill));
            entryList7.Add(new TxtcResource.TxtcResource.EntryBoolean(0, null, TxtcResource.TxtcResource.EntryBoolean.BooleanProperties.UIVisible, 0, 0));
            entryList7.Add(new TxtcResource.TxtcResource.EntryInt32(0, null, TxtcResource.TxtcResource.EntryInt32.Int32Properties.MinShaderModel, 0, 0));
            entryList7.Add(new TxtcResource.TxtcResource.EntryInt32(0, null, TxtcResource.TxtcResource.EntryInt32.Int32Properties.SkipShaderModel, 0, (int)TxtcResource.TxtcResource.EntryInt32.ShaderModel.SM_Highest));
            entryList7.Add(new TxtcResource.TxtcResource.EntryUInt32(0, null, TxtcResource.TxtcResource.EntryUInt32.UInt32Properties.MinDetailLevel, 0, 0xFFFFFFFF));
            entryList7.Add(new TxtcResource.TxtcResource.EntryUInt32(0, null, TxtcResource.TxtcResource.EntryUInt32.UInt32Properties.SkipDetailLevel, 0, (uint)TxtcResource.TxtcResource.EntryUInt32.DetailLevel.Lowest));
            entryList7.Add(new TxtcResource.TxtcResource.EntryString(0, null, TxtcResource.TxtcResource.EntryString.StringProperties.Description, 0, "Texture Step"));
            entryList7.Add(new TxtcResource.TxtcResource.EntryInt32(0, null, TxtcResource.TxtcResource.EntryInt32.Int32Properties.ColorWrite, 0,
                                                                    (int)TxtcResource.TxtcResource.EntryInt32.ColorWriteChannels.Blue + (int)TxtcResource.TxtcResource.EntryInt32.ColorWriteChannels.Green + (int)TxtcResource.TxtcResource.EntryInt32.ColorWriteChannels.Red));
            entryList7.Add(new TxtcResource.TxtcResource.EntryRectangle(0, null, TxtcResource.TxtcResource.EntryRectangle.RectangleProperties.DestinationRectangle, 0, new float[] { 0.0f, 0.0f, 1.0f, 1.0f }));
            entryList7.Add(new TxtcResource.TxtcResource.EntryBoolean(0, null, TxtcResource.TxtcResource.EntryBoolean.BooleanProperties.EnableBlending, 0, 1));
            entryList7.Add(new TxtcResource.TxtcResource.EntryInt32(0, null, TxtcResource.TxtcResource.EntryInt32.Int32Properties.SourceBlend, 0, (int)TxtcResource.TxtcResource.EntryInt32.Blend.DestinationAlpha));
            entryList7.Add(new TxtcResource.TxtcResource.EntryInt32(0, null, TxtcResource.TxtcResource.EntryInt32.Int32Properties.DestinationBlend, 0, (int)TxtcResource.TxtcResource.EntryInt32.Blend.InverseDestinationAlpha));
            entryList7.Add(new TxtcResource.TxtcResource.EntryUInt32(0, null, TxtcResource.TxtcResource.EntryUInt32.UInt32Properties.Color, 0, 0xFFE6EA0E));
            TxtcResource.TxtcResource.EntryBlock entBlock7 = new TxtcResource.TxtcResource.EntryBlock(0, null);
            entBlock7.Entries = entryList7;
            entryBlockList.Add(entBlock7);

            TxtcResource.TxtcResource.EntryList entryList8 = new TxtcResource.TxtcResource.EntryList(null);
            entryList8.Add(new TxtcResource.TxtcResource.EntryUInt32(0, null, TxtcResource.TxtcResource.EntryUInt32.UInt32Properties.ID, 0, (uint)TxtcResource.TxtcResource.EntryUInt32.StepType.ChannelSelect));
            entryList8.Add(new TxtcResource.TxtcResource.EntryBoolean(0, null, TxtcResource.TxtcResource.EntryBoolean.BooleanProperties.UIVisible, 0, 0));
            entryList8.Add(new TxtcResource.TxtcResource.EntryInt32(0, null, TxtcResource.TxtcResource.EntryInt32.Int32Properties.MinShaderModel, 0, 0));
            entryList8.Add(new TxtcResource.TxtcResource.EntryInt32(0, null, TxtcResource.TxtcResource.EntryInt32.Int32Properties.SkipShaderModel, 0, (int)TxtcResource.TxtcResource.EntryInt32.ShaderModel.SM_Highest));
            entryList8.Add(new TxtcResource.TxtcResource.EntryUInt32(0, null, TxtcResource.TxtcResource.EntryUInt32.UInt32Properties.MinDetailLevel, 0, 0xFFFFFFFF));
            entryList8.Add(new TxtcResource.TxtcResource.EntryUInt32(0, null, TxtcResource.TxtcResource.EntryUInt32.UInt32Properties.SkipDetailLevel, 0, (uint)TxtcResource.TxtcResource.EntryUInt32.DetailLevel.Lowest));
            entryList8.Add(new TxtcResource.TxtcResource.EntryString(0, null, TxtcResource.TxtcResource.EntryString.StringProperties.Description, 0, "Texture Step"));
            entryList8.Add(new TxtcResource.TxtcResource.EntryInt32(0, null, TxtcResource.TxtcResource.EntryInt32.Int32Properties.ColorWrite, 0, (int)TxtcResource.TxtcResource.EntryInt32.ColorWriteChannels.Alpha));
            entryList8.Add(new TxtcResource.TxtcResource.EntryRectangle(0, null, TxtcResource.TxtcResource.EntryRectangle.RectangleProperties.DestinationRectangle, 0, new float[] { 0.0f, 0.0f, 1.0f, 1.0f }));
            entryList8.Add(new TxtcResource.TxtcResource.EntryBoolean(0, null, TxtcResource.TxtcResource.EntryBoolean.BooleanProperties.EnableBlending, 0, 0));
            entryList8.Add(new TxtcResource.TxtcResource.EntrySingle(0, null, TxtcResource.TxtcResource.EntrySingle.SingleProperties.Rotation, 0, 0.0f));
            entryList8.Add(new TxtcResource.TxtcResource.EntryRectangle(0, null, TxtcResource.TxtcResource.EntryRectangle.RectangleProperties.SourceRectangle, 0, new float[] { 0.0f, 0.0f, 1.0f, 1.0f }));
            entryList8.Add(new TxtcResource.TxtcResource.EntryBoolean(0, null, TxtcResource.TxtcResource.EntryBoolean.BooleanProperties.EnableFiltering, 0, 1));
            entryList8.Add(new TxtcResource.TxtcResource.EntryTGIIndex(0, null, TxtcResource.TxtcResource.EntryTGIIndex.TGIIndexProperties.ImageKey, 0, 0));
            entryList8.Add(new TxtcResource.TxtcResource.EntryVector(0, null, TxtcResource.TxtcResource.EntryVector.VectorProperties.ChannelSelect, 0, new float[] { 0.0f, 0.0f, 0.0f, 1.0f }));
            TxtcResource.TxtcResource.EntryBlock entBlock8 = new TxtcResource.TxtcResource.EntryBlock(0, null);
            entBlock8.Entries = entryList8;
            entryBlockList.Add(entBlock8);

            TxtcResource.TxtcResource.EntryList entryList9 = new TxtcResource.TxtcResource.EntryList(null);
            entryList9.Add(new TxtcResource.TxtcResource.EntryUInt32(0, null, TxtcResource.TxtcResource.EntryUInt32.UInt32Properties.ID, 0, (uint)TxtcResource.TxtcResource.EntryUInt32.StepType.ColorFill));
            entryList9.Add(new TxtcResource.TxtcResource.EntryBoolean(0, null, TxtcResource.TxtcResource.EntryBoolean.BooleanProperties.UIVisible, 0, 0));
            entryList9.Add(new TxtcResource.TxtcResource.EntryInt32(0, null, TxtcResource.TxtcResource.EntryInt32.Int32Properties.MinShaderModel, 0, 0));
            entryList9.Add(new TxtcResource.TxtcResource.EntryInt32(0, null, TxtcResource.TxtcResource.EntryInt32.Int32Properties.SkipShaderModel, 0, (int)TxtcResource.TxtcResource.EntryInt32.ShaderModel.SM_Highest));
            entryList9.Add(new TxtcResource.TxtcResource.EntryUInt32(0, null, TxtcResource.TxtcResource.EntryUInt32.UInt32Properties.MinDetailLevel, 0, 0xFFFFFFFF));
            entryList9.Add(new TxtcResource.TxtcResource.EntryUInt32(0, null, TxtcResource.TxtcResource.EntryUInt32.UInt32Properties.SkipDetailLevel, 0, (uint)TxtcResource.TxtcResource.EntryUInt32.DetailLevel.Lowest));
            entryList9.Add(new TxtcResource.TxtcResource.EntryString(0, null, TxtcResource.TxtcResource.EntryString.StringProperties.Description, 0, "Texture Step"));
            entryList9.Add(new TxtcResource.TxtcResource.EntryInt32(0, null, TxtcResource.TxtcResource.EntryInt32.Int32Properties.ColorWrite, 0,
                                                                    (int)TxtcResource.TxtcResource.EntryInt32.ColorWriteChannels.Blue + (int)TxtcResource.TxtcResource.EntryInt32.ColorWriteChannels.Green + (int)TxtcResource.TxtcResource.EntryInt32.ColorWriteChannels.Red));
            entryList9.Add(new TxtcResource.TxtcResource.EntryRectangle(0, null, TxtcResource.TxtcResource.EntryRectangle.RectangleProperties.DestinationRectangle, 0, new float[] { 0.0f, 0.0f, 1.0f, 1.0f }));
            entryList9.Add(new TxtcResource.TxtcResource.EntryBoolean(0, null, TxtcResource.TxtcResource.EntryBoolean.BooleanProperties.EnableBlending, 0, 1));
            entryList9.Add(new TxtcResource.TxtcResource.EntryInt32(0, null, TxtcResource.TxtcResource.EntryInt32.Int32Properties.SourceBlend, 0, (int)TxtcResource.TxtcResource.EntryInt32.Blend.DestinationAlpha));
            entryList9.Add(new TxtcResource.TxtcResource.EntryInt32(0, null, TxtcResource.TxtcResource.EntryInt32.Int32Properties.DestinationBlend, 0, (int)TxtcResource.TxtcResource.EntryInt32.Blend.InverseDestinationAlpha));
            entryList9.Add(new TxtcResource.TxtcResource.EntryUInt32(0, null, TxtcResource.TxtcResource.EntryUInt32.UInt32Properties.Color, 0, 0xFF000000));
            TxtcResource.TxtcResource.EntryBlock entBlock9 = new TxtcResource.TxtcResource.EntryBlock(0, null);
            entBlock9.Entries = entryList9;
            entryBlockList.Add(entBlock9);

            TxtcResource.TxtcResource.EntryList entryListA = new TxtcResource.TxtcResource.EntryList(null);
            entryListA.Add(new TxtcResource.TxtcResource.EntryUInt32(0, null, TxtcResource.TxtcResource.EntryUInt32.UInt32Properties.ID, 0, (uint)TxtcResource.TxtcResource.EntryUInt32.StepType.ChannelSelect));
            entryListA.Add(new TxtcResource.TxtcResource.EntryBoolean(0, null, TxtcResource.TxtcResource.EntryBoolean.BooleanProperties.UIVisible, 0, 0));
            entryListA.Add(new TxtcResource.TxtcResource.EntryInt32(0, null, TxtcResource.TxtcResource.EntryInt32.Int32Properties.MinShaderModel, 0, 0));
            entryListA.Add(new TxtcResource.TxtcResource.EntryInt32(0, null, TxtcResource.TxtcResource.EntryInt32.Int32Properties.SkipShaderModel, 0, (int)TxtcResource.TxtcResource.EntryInt32.ShaderModel.SM_Highest));
            entryListA.Add(new TxtcResource.TxtcResource.EntryUInt32(0, null, TxtcResource.TxtcResource.EntryUInt32.UInt32Properties.MinDetailLevel, 0, 0xFFFFFFFF));
            entryListA.Add(new TxtcResource.TxtcResource.EntryUInt32(0, null, TxtcResource.TxtcResource.EntryUInt32.UInt32Properties.SkipDetailLevel, 0, (uint)TxtcResource.TxtcResource.EntryUInt32.DetailLevel.Lowest));
            entryListA.Add(new TxtcResource.TxtcResource.EntryString(0, null, TxtcResource.TxtcResource.EntryString.StringProperties.Description, 0, "Texture Step"));
            entryListA.Add(new TxtcResource.TxtcResource.EntryInt32(0, null, TxtcResource.TxtcResource.EntryInt32.Int32Properties.ColorWrite, 0, (int)TxtcResource.TxtcResource.EntryInt32.ColorWriteChannels.Alpha));
            entryListA.Add(new TxtcResource.TxtcResource.EntryRectangle(0, null, TxtcResource.TxtcResource.EntryRectangle.RectangleProperties.DestinationRectangle, 0, new float[] { 0.0f, 0.0f, 1.0f, 1.0f }));
            entryListA.Add(new TxtcResource.TxtcResource.EntryBoolean(0, null, TxtcResource.TxtcResource.EntryBoolean.BooleanProperties.EnableBlending, 0, 1));
            entryListA.Add(new TxtcResource.TxtcResource.EntryInt32(0, null, TxtcResource.TxtcResource.EntryInt32.Int32Properties.SourceBlend, 0, (int)TxtcResource.TxtcResource.EntryInt32.Blend.One));
            entryListA.Add(new TxtcResource.TxtcResource.EntryInt32(0, null, TxtcResource.TxtcResource.EntryInt32.Int32Properties.DestinationBlend, 0, (int)TxtcResource.TxtcResource.EntryInt32.Blend.One));
            entryListA.Add(new TxtcResource.TxtcResource.EntrySingle(0, null, TxtcResource.TxtcResource.EntrySingle.SingleProperties.Rotation, 0, 0.0f));
            entryListA.Add(new TxtcResource.TxtcResource.EntryRectangle(0, null, TxtcResource.TxtcResource.EntryRectangle.RectangleProperties.SourceRectangle, 0, new float[] { 0.0f, 0.0f, 1.0f, 1.0f }));
            entryListA.Add(new TxtcResource.TxtcResource.EntryBoolean(0, null, TxtcResource.TxtcResource.EntryBoolean.BooleanProperties.EnableFiltering, 0, 1));
            entryListA.Add(new TxtcResource.TxtcResource.EntryTGIIndex(0, null, TxtcResource.TxtcResource.EntryTGIIndex.TGIIndexProperties.ImageKey, 0, 0));
            entryListA.Add(new TxtcResource.TxtcResource.EntryVector(0, null, TxtcResource.TxtcResource.EntryVector.VectorProperties.ChannelSelect, 0, new float[] { 1.0f, 1.0f, 1.0f, 1.0f }));
            TxtcResource.TxtcResource.EntryBlock entBlockA = new TxtcResource.TxtcResource.EntryBlock(0, null);
            entBlockA.Entries = entryListA;
            entryBlockList.Add(entBlockA);

            TxtcResource.TxtcResource.EntryList entryListB = new TxtcResource.TxtcResource.EntryList(null);
            entryListB.Add(new TxtcResource.TxtcResource.EntryUInt32(0, null, TxtcResource.TxtcResource.EntryUInt32.UInt32Properties.ID, 0, (uint)TxtcResource.TxtcResource.EntryUInt32.StepType.SetTarget));
            entryListB.Add(new TxtcResource.TxtcResource.EntryBoolean(0, null, TxtcResource.TxtcResource.EntryBoolean.BooleanProperties.UIVisible, 0, 0));
            entryListB.Add(new TxtcResource.TxtcResource.EntryInt32(0, null, TxtcResource.TxtcResource.EntryInt32.Int32Properties.MinShaderModel, 0, 0));
            entryListB.Add(new TxtcResource.TxtcResource.EntryInt32(0, null, TxtcResource.TxtcResource.EntryInt32.Int32Properties.SkipShaderModel, 0, (int)TxtcResource.TxtcResource.EntryInt32.ShaderModel.SM_Highest));
            entryListB.Add(new TxtcResource.TxtcResource.EntryUInt32(0, null, TxtcResource.TxtcResource.EntryUInt32.UInt32Properties.MinDetailLevel, 0, 0xFFFFFFFF));
            entryListB.Add(new TxtcResource.TxtcResource.EntryUInt32(0, null, TxtcResource.TxtcResource.EntryUInt32.UInt32Properties.SkipDetailLevel, 0, (uint)TxtcResource.TxtcResource.EntryUInt32.DetailLevel.Lowest));
            entryListB.Add(new TxtcResource.TxtcResource.EntryString(0, null, TxtcResource.TxtcResource.EntryString.StringProperties.Description, 0, "Texture Step"));
            entryListB.Add(new TxtcResource.TxtcResource.EntryUInt32(0, null, TxtcResource.TxtcResource.EntryUInt32.UInt32Properties.RenderTarget, 0, (uint)TxtcResource.TxtcResource.EntryUInt32.RenderTarget.RenderTarget_A));
            TxtcResource.TxtcResource.EntryBlock entBlockB = new TxtcResource.TxtcResource.EntryBlock(0, null);
            entBlockB.Entries = entryListB;
            entryBlockList.Add(entBlockB);

            TxtcResource.TxtcResource.EntryList entryListC = new TxtcResource.TxtcResource.EntryList(null);
            entryListC.Add(new TxtcResource.TxtcResource.EntryUInt32(0, null, TxtcResource.TxtcResource.EntryUInt32.UInt32Properties.ID, 0, (uint)TxtcResource.TxtcResource.EntryUInt32.StepType.DrawImage));
            entryListC.Add(new TxtcResource.TxtcResource.EntryBoolean(0, null, TxtcResource.TxtcResource.EntryBoolean.BooleanProperties.UIVisible, 0, 0));
            entryListC.Add(new TxtcResource.TxtcResource.EntryInt32(0, null, TxtcResource.TxtcResource.EntryInt32.Int32Properties.MinShaderModel, 0, 0));
            entryListC.Add(new TxtcResource.TxtcResource.EntryInt32(0, null, TxtcResource.TxtcResource.EntryInt32.Int32Properties.SkipShaderModel, 0, (int)TxtcResource.TxtcResource.EntryInt32.ShaderModel.SM_Highest));
            entryListC.Add(new TxtcResource.TxtcResource.EntryUInt32(0, null, TxtcResource.TxtcResource.EntryUInt32.UInt32Properties.MinDetailLevel, 0, 0xFFFFFFFF));
            entryListC.Add(new TxtcResource.TxtcResource.EntryUInt32(0, null, TxtcResource.TxtcResource.EntryUInt32.UInt32Properties.SkipDetailLevel, 0, (uint)TxtcResource.TxtcResource.EntryUInt32.DetailLevel.Lowest));
            entryListC.Add(new TxtcResource.TxtcResource.EntryString(0, null, TxtcResource.TxtcResource.EntryString.StringProperties.Description, 0, "Texture Step"));
            entryListC.Add(new TxtcResource.TxtcResource.EntryInt32(0, null, TxtcResource.TxtcResource.EntryInt32.Int32Properties.ColorWrite, 0,
                                                                    (int)TxtcResource.TxtcResource.EntryInt32.ColorWriteChannels.Blue + (int)TxtcResource.TxtcResource.EntryInt32.ColorWriteChannels.Green + (int)TxtcResource.TxtcResource.EntryInt32.ColorWriteChannels.Red));
            entryListC.Add(new TxtcResource.TxtcResource.EntryRectangle(0, null, TxtcResource.TxtcResource.EntryRectangle.RectangleProperties.DestinationRectangle, 0, new float[] { 0.0f, 0.0f, 1.0f, 1.0f }));
            entryListC.Add(new TxtcResource.TxtcResource.EntryBoolean(0, null, TxtcResource.TxtcResource.EntryBoolean.BooleanProperties.EnableBlending, 0, 1));
            entryListC.Add(new TxtcResource.TxtcResource.EntryInt32(0, null, TxtcResource.TxtcResource.EntryInt32.Int32Properties.SourceBlend, 0, (int)TxtcResource.TxtcResource.EntryInt32.Blend.SourceAlpha));
            entryListC.Add(new TxtcResource.TxtcResource.EntryInt32(0, null, TxtcResource.TxtcResource.EntryInt32.Int32Properties.DestinationBlend, 0, (int)TxtcResource.TxtcResource.EntryInt32.Blend.InverseSourceAlpha));
            entryListC.Add(new TxtcResource.TxtcResource.EntrySingle(0, null, TxtcResource.TxtcResource.EntrySingle.SingleProperties.Rotation, 0, 0.0f));
            entryListC.Add(new TxtcResource.TxtcResource.EntryRectangle(0, null, TxtcResource.TxtcResource.EntryRectangle.RectangleProperties.SourceRectangle, 0, new float[] { 0.0f, 0.0f, 1.0f, 1.0f }));
            entryListC.Add(new TxtcResource.TxtcResource.EntryBoolean(0, null, TxtcResource.TxtcResource.EntryBoolean.BooleanProperties.EnableFiltering, 0, 0));
            entryListC.Add(new TxtcResource.TxtcResource.EntryUInt32(0, null, TxtcResource.TxtcResource.EntryUInt32.UInt32Properties.ImageSource, 0, 0x021E9CD5));
            TxtcResource.TxtcResource.EntryBlock entBlockC = new TxtcResource.TxtcResource.EntryBlock(0, null);
            entBlockC.Entries = entryListC;
            entryBlockList.Add(entBlockC);

            txtc.Root.Entries = entryBlockList;

            CountedTGIBlockList tgi = new CountedTGIBlockList(null);

            tgi.Add(tatTGI);
            txtc.Root.TGIBlocks = tgi;

            return(txtc);
        }
Exemplo n.º 28
0
 public LODBlockList(EventHandler handler, Stream s, CountedTGIBlockList tgiList) : base(handler)
 {
     this.tgiList = tgiList;
     this.Parse(s);
 }
Exemplo n.º 29
0
 public LODBlockList(EventHandler handler, CountedTGIBlockList tgiList) : base(handler)
 {
     this.tgiList = tgiList;
 }
Exemplo n.º 30
0
 public LODInfoEntry(int apiVersion, EventHandler handler, CountedTGIBlockList tgiList) : base(apiVersion, handler)
 {
     this.tgiList = tgiList;
 }
Exemplo n.º 31
0
 private void btnTGIEditor_Click(object sender, EventArgs e)
 {
     CountedTGIBlockList tgiBlocksCopy = new CountedTGIBlockList(null, vpxy.TGIBlocks);
     DialogResult dr = TGIBlockListEditor.Show(tgiBlocksCopy);
     if (dr != DialogResult.OK) return;
     vpxy.TGIBlocks.Clear();
     vpxy.TGIBlocks.AddRange(tgiBlocksCopy.ToArray());
 }
Exemplo n.º 32
0
 public LODInfoEntry(int APIversion, EventHandler handler, Stream s, CountedTGIBlockList tgiList) : base(APIversion, handler)
 {
     this.tgiList = tgiList; Parse(s);
 }
Exemplo n.º 33
0
        protected override Stream UnParse()
        {
            MemoryStream s = new MemoryStream();
            BinaryWriter w = new BinaryWriter(s);

            w.Write(this.version);
            w.Write(0); // tgi offset
            w.Write(presetCount);
            BigEndianUnicodeString.Write(s, name);
            w.Write(sortPriority);
            w.Write(secondarySortIndex);
            w.Write(propertyID);
            w.Write(auralMaterialHash);
            w.Write((byte)parmFlags);
            w.Write((ulong)excludePartFlags);
            w.Write(excludeModifierRegionFlags);
            if (this.flagList == null)
            {
                this.flagList = new FlagList(OnResourceChanged);
            }
            flagList.UnParse(s);
            w.Write(simlolencePrice);
            w.Write(partTitleKey);
            w.Write(partDesptionKey);
            w.Write(uniqueTextureSpace);
            w.Write(bodyType);
            w.Write(unused1);
            w.Write((uint)ageGender);
            w.Write(unused2);
            w.Write(unused3);
            if (this.swatchColorCode == null)
            {
                this.swatchColorCode = new SwatchColorList(OnResourceChanged);
            }
            swatchColorCode.UnParse(s);
            w.Write(buffResKey);
            w.Write(varientThumbnailKey);
            if (this.version >= 0x1C)
            {
                w.Write(voiceEffectHash);
            }
            w.Write(nakedKey);
            w.Write(parentKey);
            w.Write(sortLayer);
            if (this.lodBlockList == null)
            {
                this.lodBlockList = new LODBlockList(OnResourceChanged);
            }
            lodBlockList.UnParse(s);
            if (this.slotKey == null)
            {
                this.slotKey = new SimpleList <byte>(OnResourceChanged);
            }
            w.Write((byte)this.slotKey.Count);
            foreach (var b in this.slotKey)
            {
                w.Write(b);
            }
            w.Write(diffuseShadowKey);
            w.Write(shadowKey);
            w.Write(compositionMethod);
            w.Write(regionMapKey);
            w.Write(overrides);
            w.Write(normalMapKey);
            w.Write(specularMapKey);
            if (this.version >= 0x1B)
            {
                w.Write(sharedUVMapSpace);
            }
            long tgiPosition = w.BaseStream.Position;

            w.BaseStream.Position = 4;
            w.Write(tgiPosition - 8);
            w.BaseStream.Position = tgiPosition;
            if (this.tgiList == null)
            {
                this.tgiList = new CountedTGIBlockList(OnResourceChanged);
            }
            w.Write((byte)tgiList.Count);
            foreach (var tgi in tgiList)
            {
                tgi.UnParse(s);
            }

            return(s);
        }
Exemplo n.º 34
0
 protected override Stream UnParse()
 {
     var s = new MemoryStream();
     var bw = new BinaryWriter(s);
     bw.Write(this.version);
     if (this.commonBlock == null) { this.commonBlock = new CatalogCommon(kRecommendedApiVersion, this.OnResourceChanged); }
     this.commonBlock.UnParse(s);
     bw.Write(this.hashIndicator);
     bw.Write(this.hash01);
     bw.Write(this.hash02);
     bw.Write(this.hash03);
     bw.Write(Convert.ToUInt32(matdList.Count));
     if (this.matdList == null) { this.matdList = new CountedTGIBlockList(this.OnResourceChanged, TGIBlock.Order.ITG); }
     this.matdList.UnParse(s);
     return s;
 }
Exemplo n.º 35
0
 void Parse(Stream s)
 {
     var br = new BinaryReader(s);
     this.version = br.ReadUInt32();
     this.commonBlock = new CatalogCommon(kRecommendedApiVersion, this.OnResourceChanged, s);
     this.hashIndicator = br.ReadUInt32();
     this.hash01 = br.ReadUInt32();
     this.hash02 = br.ReadUInt32();
     this.hash03 = br.ReadUInt32();
     int count = Convert.ToUInt16(br.ReadUInt32());
     this.matdList = new CountedTGIBlockList(this.OnResourceChanged, TGIBlock.Order.ITG, count, s);
 }
Exemplo n.º 36
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(0, 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);
        }
Exemplo n.º 37
0
        void Parse(Stream s)
        {
            s.Position = 0;
            BinaryReader r = new BinaryReader(s);

            version     = r.ReadUInt32();
            tgiOffset   = r.ReadUInt32() + 8;
            presetCount = r.ReadUInt32();
            if (presetCount != 0)
            {
                throw new Exception("Found non-zero one");
            }
            name = BigEndianUnicodeString.Read(s);

            sortPriority            = r.ReadSingle();
            this.secondarySortIndex = r.ReadUInt16();
            propertyID                      = r.ReadUInt32();
            this.auralMaterialHash          = r.ReadUInt32();
            this.parmFlags                  = (ParmFlag)r.ReadByte();
            this.excludePartFlags           = (ExcludePartFlag)r.ReadUInt64();
            this.excludeModifierRegionFlags = r.ReadUInt32();

            flagList = new FlagList(OnResourceChanged, s);

            this.simlolencePrice    = r.ReadUInt32();
            this.partTitleKey       = r.ReadUInt32();
            this.partDesptionKey    = r.ReadUInt32();
            this.uniqueTextureSpace = r.ReadByte();
            this.bodyType           = r.ReadInt32();
            this.unused1            = r.ReadInt32();
            this.ageGender          = (AgeGenderFlags)r.ReadUInt32();
            this.unused2            = r.ReadByte();
            this.unused3            = r.ReadByte();

            swatchColorCode = new SwatchColorList(OnResourceChanged, s);

            this.buffResKey          = r.ReadByte();
            this.varientThumbnailKey = r.ReadByte();
            if (this.version >= 0x1C)
            {
                this.voiceEffectHash = r.ReadUInt64();
            }
            this.nakedKey  = r.ReadByte();
            this.parentKey = r.ReadByte();
            this.sortLayer = r.ReadInt32();

            // Don't move any of this before the -----
            // TGI block list
            long currentPosition = r.BaseStream.Position;

            r.BaseStream.Position = tgiOffset;
            byte count4 = r.ReadByte();

            tgiList = new CountedTGIBlockList(OnResourceChanged, "IGT", count4, s);
            r.BaseStream.Position = currentPosition;
            lodBlockList          = new LODBlockList(null, s, tgiList);
            //-------------

            byte count = r.ReadByte();

            this.slotKey = new SimpleList <byte>(null);
            for (byte i = 0; i < count; i++)
            {
                this.slotKey.Add(r.ReadByte());
            }

            this.diffuseShadowKey  = r.ReadByte();
            this.shadowKey         = r.ReadByte();
            this.compositionMethod = r.ReadByte();
            this.regionMapKey      = r.ReadByte();
            this.overrides         = r.ReadByte();
            this.normalMapKey      = r.ReadByte();
            this.specularMapKey    = r.ReadByte();
            if (this.version >= 0x1B)
            {
                this.sharedUVMapSpace = r.ReadUInt32();
            }
        }
Exemplo n.º 38
0
        void saveVPXY()
        {
            rcol.ResourceChanged -= new EventHandler(rcol_ResourceChanged);
            try
            {
                ClearLinkedPartsTLP(true);
                CountedTGIBlockList ltgib = new CountedTGIBlockList(null);
                vpxy.Entries.Clear();
                int count = 0;
                byte count00 = 1;
                for (int row = 1; row < tlpParts.RowCount - 1; row++)
                {
                    TGIBlockCombo c = tlpParts.GetControlFromPosition(2, row) as TGIBlockCombo;
                    if (ltbc.IndexOf(c) < 0) continue;
                    if (c.SelectedIndex < 0) continue;
                    ltgib.Add(vpxy.TGIBlocks[c.SelectedIndex]);
                    vpxy.Entries.Add(new VPXY.Entry01(0, null, 1, count++));
                    if (c.Tag != null)
                    {
                        VPXY.Entry00 e00 = c.Tag as VPXY.Entry00;
                        if (e00.TGIIndexes.Count <= 0) continue;
                        e00.EntryID = count00++;
                        e00.TGIIndexes.ForEach(elem =>
                        {
                            ltgib.Add(vpxy.TGIBlocks[elem]);
                            elem = count++;
                        });
                        if (e00.TGIIndexes.Count > 0)
                            vpxy.Entries.Add(e00);
                    }
                }
                if (vpxy.Modular)
                {
                    ltgib.Add(vpxy.TGIBlocks[tbcFTPT.SelectedIndex]);
                    vpxy.FTPTIndex = count++;
                }

                vpxy.TGIBlocks.Clear();
                vpxy.TGIBlocks.AddRange(ltgib);

                result = (byte[])rcol.AsBytes.Clone();
            }
            finally { rcol.ResourceChanged -= new EventHandler(rcol_ResourceChanged); }
        }