Esempio n. 1
0
        /// <summary>
        /// Reads the data-block from a stream.
        /// </summary>
        public override void Read(ResourceDataReader reader, params object[] parameters)
        {
            base.Read(reader, parameters);

            // read structure data
            this.Unknown_10h          = reader.ReadUInt32();
            this.Unknown_14h          = reader.ReadUInt32();
            this.Unknown_18h          = reader.ReadUInt32();
            this.Unknown_1Ch          = reader.ReadUInt32();
            this.TextureNameHashesPtr = reader.ReadStruct <ResourceSimpleList64Ptr>();
            this.TextureNameHashes    = reader.ReadUintsAt(this.TextureNameHashesPtr.EntriesPointer, this.TextureNameHashesPtr.EntriesCount);
            //this.TextureNameHashes = reader.ReadBlock<ResourceSimpleList64<uint_r>>();
            this.Textures = reader.ReadBlock <ResourcePointerList64 <Texture> >();

            var dict = new Dictionary <uint, Texture>();

            if ((Textures != null) && (Textures.data_items != null) && (TextureNameHashes != null))
            {
                for (int i = 0; (i < Textures.data_items.Length) && (i < TextureNameHashes.Length); i++)
                {
                    var tex  = Textures.data_items[i];
                    var hash = TextureNameHashes[i];
                    dict[hash] = tex;
                }
            }
            Dict = new Dictionary <uint, Texture>(dict);
        }
Esempio n. 2
0
        public override void Read(ResourceDataReader reader, params object[] parameters)
        {
            VFT                = reader.ReadUInt32();
            Unknown_04h        = reader.ReadUInt32();
            ItemCount          = reader.ReadUInt32();
            Unknown_0Ch        = reader.ReadUInt32();
            ListPartsPointer   = reader.ReadUInt64();
            ListOffsetsPointer = reader.ReadUInt64();
            ListPartsCount     = reader.ReadUInt32();
            Unknown_24h        = reader.ReadUInt32();
            Unknown_28h        = reader.ReadUInt32();
            Unknown_2Ch        = reader.ReadUInt32();

            ListParts   = reader.ReadBlockAt <ResourceSimpleArray <NavMeshListPart <T> > >(ListPartsPointer, ListPartsCount);
            ListOffsets = reader.ReadUintsAt(ListOffsetsPointer, ListPartsCount);
        }