Example #1
0
        public override void Read(ResourceDataReader reader, params object[] parameters)
        {
            base.Read(reader, parameters);

            this.NodesPointer                = reader.ReadUInt64();
            this.NodesCount                  = reader.ReadUInt32();
            this.NodesCountVehicle           = reader.ReadUInt32();
            this.NodesCountPed               = reader.ReadUInt32();
            this.Unk24                       = reader.ReadUInt32();
            this.LinksPtr                    = reader.ReadUInt64();
            this.LinksCount                  = reader.ReadUInt32();
            this.Unk34                       = reader.ReadUInt32();
            this.JunctionsPtr                = reader.ReadUInt64();
            this.JunctionHeightmapBytesPtr   = reader.ReadUInt64();
            this.Unk48                       = reader.ReadUInt32();
            this.Unk4C                       = reader.ReadUInt32();
            this.JunctionRefsPtr             = reader.ReadUInt64();
            this.JunctionRefsCount0          = reader.ReadUInt16();
            this.JunctionRefsCount1          = reader.ReadUInt16();
            this.Unk5C                       = reader.ReadUInt32();
            this.JunctionsCount              = reader.ReadUInt32();
            this.JunctionHeightmapBytesCount = reader.ReadUInt32();
            this.Unk68                       = reader.ReadUInt32();
            this.Unk6C                       = reader.ReadUInt32();

            this.Nodes     = reader.ReadStructsAt <Node>(this.NodesPointer, this.NodesCount);
            this.Links     = reader.ReadStructsAt <NodeLink>(this.LinksPtr, this.LinksCount);
            this.Junctions = reader.ReadStructsAt <NodeJunction>(this.JunctionsPtr, this.JunctionsCount);
            this.JunctionHeightmapBytes = reader.ReadBytesAt(this.JunctionHeightmapBytesPtr, this.JunctionHeightmapBytesCount);
            this.JunctionRefs           = reader.ReadStructsAt <NodeJunctionRef>(this.JunctionRefsPtr, this.JunctionRefsCount1);
        }
Example #2
0
        public override void Read(ResourceDataReader reader, params object[] parameters)
        {
            PointsStartID  = reader.ReadUInt32();
            Unused_04h     = reader.ReadUInt32();
            PolyIDsPointer = reader.ReadUInt64();
            PointsPointer  = reader.ReadUInt64();
            PolyIDsCount   = reader.ReadUInt16();
            PointsCount    = reader.ReadUInt16();
            Unused_1Ch     = reader.ReadUInt32();

            PolyIDs = reader.ReadUshortsAt(PolyIDsPointer, PolyIDsCount);
            Points  = reader.ReadStructsAt <NavMeshPoint>(PointsPointer, PointsCount);
        }
Example #3
0
        public override void Read(ResourceDataReader reader, params object[] parameters)
        {
            UnkOffset      = reader.ReadUInt32();
            Unused_04h     = reader.ReadUInt32();
            PolyIDsPointer = reader.ReadUInt64();
            UnkDataPointer = reader.ReadUInt64();
            PolyIDsCount   = reader.ReadUInt16();
            UnkDataCount   = reader.ReadUInt16();
            Unused_1Ch     = reader.ReadUInt32();

            PolyIDs = reader.ReadUshortsAt(PolyIDsPointer, PolyIDsCount);
            UnkData = reader.ReadStructsAt <NavMeshSectorDataUnk>(UnkDataPointer, UnkDataCount);
        }
Example #4
0
        /// <summary>
        /// Reads the data block.
        /// </summary>
        public override void Read(ResourceDataReader reader, params object[] parameters)
        {
            if (parameters[1] is uint[])
            {
                //version for raw arrays from dexy

                var numEl2 = (uint[])parameters[1];

                ptr_list = new List <ulong>();
                for (int i = 0; i < numEl2.Length; i++)
                {
                    ptr_list.Add(reader.ReadUInt64());
                }

                for (int i = 0; i < numEl2.Length; i++)
                {
                    var xarr = reader.ReadBlockAt <ResourceSimpleArray <T> >(ptr_list[i], numEl2[i]);
                    Data.Add(xarr);
                }

                return;
            }



            var numEl = (ResourceSimpleArray <uint_r>)parameters[1];

            ptr_list = new List <ulong>();
            for (int i = 0; i < numEl.Count; i++)
            {
                ptr_list.Add(reader.ReadUInt64());
            }

            for (int i = 0; i < numEl.Count; i++)
            {
                var xarr = reader.ReadBlockAt <ResourceSimpleArray <T> >(ptr_list[i], (uint)numEl[i]);
                Data.Add(xarr);
            }

            //int numElements = Convert.ToInt32(parameters[0]);

            //Data = new List<T>();
            //for (int i = 0; i < numElements; i++)
            //{
            //    T item = reader.ReadBlock<T>();
            //    Data.Add(item);
            //}
        }
Example #5
0
        /// <summary>
        /// Reads the data-block from a stream.
        /// </summary>
        public override void Read(ResourceDataReader reader, params object[] parameters)
        {
            // read structure data
            this.VFT         = reader.ReadUInt32();
            this.Unknown_4h  = reader.ReadUInt32();
            this.Unknown_8h  = reader.ReadUInt32();
            this.Unknown_Ch  = reader.ReadUInt32();
            this.Unknown_10h = reader.ReadUInt32();
            this.Unknown_14h = reader.ReadUInt32();
            this.Unknown_18h = reader.ReadUInt32();
            this.Unknown_1Ch = reader.ReadUInt32();
            this.Unknown_20h = reader.ReadBlock <ResourcePointerList64 <ExpressionUnk1> >();
            this.Unknown_30h = reader.ReadBlock <ResourceSimpleList64_uint>();
            this.Unknown_40h = reader.ReadBlock <ResourceSimpleList64 <ExpressionUnk2> >();
            this.Unknown_50h = reader.ReadBlock <ResourceSimpleList64_uint>();
            this.NamePointer = reader.ReadUInt64();
            this.Unknown_68h = reader.ReadUInt32();
            this.Unknown_6Ch = reader.ReadUInt32();
            this.Unknown_70h = reader.ReadUInt32();
            this.Unknown_74h = reader.ReadUInt32();
            this.len         = reader.ReadUInt16();
            this.Unknown_7Ah = reader.ReadUInt16();
            this.Unknown_7Ch = reader.ReadUInt32();
            this.Unknown_80h = reader.ReadUInt32();
            this.Unknown_84h = reader.ReadUInt32();
            this.Unknown_88h = reader.ReadUInt32();
            this.Unknown_8Ch = reader.ReadUInt32();

            // read reference data
            this.Name = reader.ReadBlockAt <string_r>(
                this.NamePointer // offset
                );
        }
Example #6
0
        /// <summary>
        /// Reads the data-block from a stream.
        /// </summary>
        public override void Read(ResourceDataReader reader, params object[] parameters)
        {
            // read structure data
            this.VFT         = reader.ReadUInt32();
            this.Unknown_4h  = reader.ReadUInt32();
            this.Unknown_8h  = reader.ReadUInt32();
            this.Unknown_Ch  = reader.ReadUInt32();
            this.Unknown_10h = reader.ReadUInt32();
            this.Unknown_14h = reader.ReadUInt32();
            this.Unknown_18h = reader.ReadUInt32();
            this.Unknown_1Ch = reader.ReadUInt32();
            this.Unknown_20h = reader.ReadUInt32();
            this.Unknown_24h = reader.ReadUInt32();
            this.NamePointer = reader.ReadUInt64();
            this.Unknown_30h = reader.ReadUInt32();
            this.Unknown_34h = reader.ReadUInt32();
            this.Unknown_38h = reader.ReadUInt32();
            this.Unknown_3Ch = reader.ReadUInt32();

            // read reference data
            this.Name = reader.ReadStringAt( //BlockAt<string_r>(
                this.NamePointer             // offset
                );

            if (!string.IsNullOrEmpty(Name))
            {
                NameHash = JenkHash.GenHash(Name.ToLowerInvariant());
            }
        }
Example #7
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);
        }
Example #8
0
        /// <summary>
        /// Reads the data-block from a stream.
        /// </summary>
        public override void Read(ResourceDataReader reader, params object[] parameters)
        {
            // read structure data
            this.EntriesPointer  = reader.ReadUInt64();
            this.EntriesCount    = reader.ReadUInt16();
            this.EntriesCapacity = reader.ReadUInt16();
            reader.Position     += 4;

            // read reference data
            //this.Entries = reader.ReadBlockAt<ResourceSimpleArray<T>>(
            //    this.EntriesPointer, // offset
            //    this.EntriesCount
            //);

            //TODO: NEEDS TO BE TESTED!!!
            data_items = new T[EntriesCount];
            var posbckp = reader.Position;

            reader.Position = (long)EntriesPointer;
            for (int i = 0; i < EntriesCount; i++)
            {
                data_items[i] = reader.ReadBlock <T>();
            }
            reader.Position = posbckp;
        }
Example #9
0
        public override void Read(ResourceDataReader reader, params object[] parameters)
        {
            base.Read(reader, parameters);

            // read structure data
            this.Width       = reader.ReadUInt16();
            this.Height      = reader.ReadUInt16();
            this.Depth       = reader.ReadUInt16();
            this.Stride      = reader.ReadUInt16();
            this.Format      = (TextureFormat)reader.ReadUInt32();
            this.Unknown_5Ch = reader.ReadByte();
            this.Levels      = reader.ReadByte();
            this.Unknown_5Eh = reader.ReadUInt16();
            this.Unknown_60h = reader.ReadUInt32();
            this.Unknown_64h = reader.ReadUInt32();
            this.Unknown_68h = reader.ReadUInt32();
            this.Unknown_6Ch = reader.ReadUInt32();
            this.DataPointer = reader.ReadUInt64();
            this.Unknown_78h = reader.ReadUInt32();
            this.Unknown_7Ch = reader.ReadUInt32();
            this.Unknown_80h = reader.ReadUInt32();
            this.Unknown_84h = reader.ReadUInt32();
            this.Unknown_88h = reader.ReadUInt32();
            this.Unknown_8Ch = reader.ReadUInt32();

            // read reference data
            this.Data = reader.ReadBlockAt <TextureData>(this.DataPointer, this.Format, this.Width, this.Height, this.Levels, this.Stride);
        }
Example #10
0
        public override void Read(ResourceDataReader reader, params object[] parameters)
        {
            Pointer     = reader.ReadUInt64();
            Count       = reader.ReadUInt32();
            Unknown_0Ch = reader.ReadUInt32();

            Items = reader.ReadStructsAt <T>(Pointer, Count);
        }
Example #11
0
        public override void Read(ResourceDataReader reader, params object[] parameters)
        {
            AABBMin         = reader.ReadVector4();
            AABBMax         = reader.ReadVector4();
            CellAABB        = reader.ReadStruct <NavMeshAABB>();
            DataPointer     = reader.ReadUInt64();
            SubTree1Pointer = reader.ReadUInt64();
            SubTree2Pointer = reader.ReadUInt64();
            SubTree3Pointer = reader.ReadUInt64();
            SubTree4Pointer = reader.ReadUInt64();
            Unused_54h      = reader.ReadUInt32();
            Unused_58h      = reader.ReadUInt32();
            Unused_5Ch      = reader.ReadUInt32();

            Data     = reader.ReadBlockAt <NavMeshSectorData>(DataPointer);
            SubTree1 = reader.ReadBlockAt <NavMeshSector>(SubTree1Pointer);
            SubTree2 = reader.ReadBlockAt <NavMeshSector>(SubTree2Pointer);
            SubTree3 = reader.ReadBlockAt <NavMeshSector>(SubTree3Pointer);
            SubTree4 = reader.ReadBlockAt <NavMeshSector>(SubTree4Pointer);
        }
Example #12
0
        /// <summary>
        /// Reads the data-block from a stream.
        /// </summary>
        public override void Read(ResourceDataReader reader, params object[] parameters)
        {
            // read structure data
            this.FileVFT              = reader.ReadUInt32();
            this.FileUnknown          = reader.ReadUInt32();
            this.FilePagesInfoPointer = reader.ReadUInt64();

            // read reference data
            this.FilePagesInfo = reader.ReadBlockAt <ResourcePagesInfo>(
                this.FilePagesInfoPointer // offset
                );
        }
Example #13
0
        public override void Read(ResourceDataReader reader, params object[] parameters)
        {
            // read structure data
            this.VFT         = reader.ReadUInt32();
            this.Unknown_4h  = reader.ReadUInt32();
            this.Unknown_8h  = reader.ReadUInt32();
            this.Unknown_Ch  = reader.ReadUInt32();
            this.Unknown_10h = reader.ReadUInt32();
            this.Unknown_14h = reader.ReadUInt32();
            this.Unknown_18h = reader.ReadUInt32();
            this.Unknown_1Ch = reader.ReadUInt32();
            this.Unknown_20h = reader.ReadUInt32();
            this.Unknown_24h = reader.ReadUInt32();
            this.NamePointer = reader.ReadUInt64();
            this.Unknown_30h = reader.ReadUInt16();
            this.Unknown_32h = reader.ReadUInt16();
            this.Unknown_34h = reader.ReadUInt32();
            this.Unknown_38h = reader.ReadUInt32();
            this.Unknown_3Ch = reader.ReadUInt32();

            // read reference data
            this.Name = reader.ReadStringAt( //BlockAt<string_r>(
                this.NamePointer             // offset
                );

            if (!string.IsNullOrEmpty(Name))
            {
                NameHash = JenkHash.GenHash(Name.ToLowerInvariant());
            }

            switch (Unknown_32h)
            {
            case 0x20:
            case 0x28:
            case 0x30:
            case 0x38:
            case 0x40:
            case 0x48:
            case 0x80:
            case 0x90:
            case 0x2:    //embedded
                break;

            default:
                break;
            }
        }
Example #14
0
        public override void Read(ResourceDataReader reader, params object[] parameters)
        {
            base.Read(reader, parameters);

            this.Unknown_10h    = reader.ReadUInt32();
            this.Unknown_14h    = reader.ReadUInt32();
            this.EntriesPointer = reader.ReadUInt64();
            this.EntriesCount   = reader.ReadUInt32();
            this.Unknown_24h    = reader.ReadUInt32();
            this.Unknown_28h    = reader.ReadUInt32();
            this.Unknown_2Ch    = reader.ReadUInt32();

            this.Entries = reader.ReadBlockAt <ResourceSimpleArray <WaypointRecordEntry> >(
                this.EntriesPointer, // offset
                this.EntriesCount
                );
        }
Example #15
0
        public override void Read(ResourceDataReader reader, params object[] parameters)
        {
            base.Read(reader, parameters);

            ContentFlags         = (NavMeshFlags)reader.ReadUInt32();
            VersionUnk1          = reader.ReadUInt32();
            Unused_018h          = reader.ReadUInt32();
            Unused_01Ch          = reader.ReadUInt32();
            Transform            = reader.ReadMatrix();
            AABBSize             = reader.ReadVector3();
            AABBUnk              = reader.ReadSingle();
            VerticesPointer      = reader.ReadUInt64();
            Unused_078h          = reader.ReadUInt32();
            Unused_07Ch          = reader.ReadUInt32();
            IndicesPointer       = reader.ReadUInt64();
            AdjPolysPointer      = reader.ReadUInt64();
            AdjPolysIndicesCount = reader.ReadUInt32();
            AdjAreaIDs           = reader.ReadStruct <NavMeshUintArray>();
            PolysPointer         = reader.ReadUInt64();
            SectorTreePointer    = reader.ReadUInt64();
            PortalsPointer       = reader.ReadUInt64();
            PortalLinksPointer   = reader.ReadUInt64();
            VerticesCount        = reader.ReadUInt32();
            PolysCount           = reader.ReadUInt32();
            AreaID           = reader.ReadUInt32();
            TotalBytes       = reader.ReadUInt32();
            SectorUnkCount   = reader.ReadUInt32();
            PortalsCount     = reader.ReadUInt32();
            PortalLinksCount = reader.ReadUInt32();
            Unused_154h      = reader.ReadUInt32();
            Unused_158h      = reader.ReadUInt32();
            Unused_15Ch      = reader.ReadUInt32();
            VersionUnk2      = reader.ReadUInt32();
            Unused_164h      = reader.ReadUInt32();
            Unused_168h      = reader.ReadUInt32();
            Unused_16Ch      = reader.ReadUInt32();



            Vertices    = reader.ReadBlockAt <NavMeshList <NavMeshVertex> >(VerticesPointer);
            Indices     = reader.ReadBlockAt <NavMeshList <ushort> >(IndicesPointer);
            AdjPolys    = reader.ReadBlockAt <NavMeshList <NavMeshAdjPoly> >(AdjPolysPointer);
            Polys       = reader.ReadBlockAt <NavMeshList <NavMeshPoly> >(PolysPointer);
            SectorTree  = reader.ReadBlockAt <NavMeshSector>(SectorTreePointer);
            Portals     = reader.ReadStructsAt <NavMeshPortal>(PortalsPointer, PortalsCount);
            PortalLinks = reader.ReadUshortsAt(PortalLinksPointer, PortalLinksCount);
        }
Example #16
0
        public override void Read(ResourceDataReader reader, params object[] parameters)
        {
            this.EntriesPointer  = reader.ReadUInt64();
            this.EntriesCount    = reader.ReadUInt16();
            this.EntriesCapacity = reader.ReadUInt16();
            reader.Position     += 4;

            //this.Entries = reader.ReadBlockAt<ResourcePointerArray64<T>>(
            //    this.EntriesPointer, // offset
            //    this.EntriesCount
            //);

            data_pointers = reader.ReadUlongsAt(EntriesPointer, EntriesCount);
            data_items    = new T[EntriesCount];
            for (int i = 0; i < EntriesCount; i++)
            {
                data_items[i] = reader.ReadBlockAt <T>(data_pointers[i]);
            }
        }
Example #17
0
        public override void Read(ResourceDataReader reader, params object[] parameters)
        {
            base.Read(reader, parameters);

            ContentFlags       = (NavMeshFlags)reader.ReadUInt32();
            VersionUnk1        = reader.ReadUInt32();
            Unused_018h        = reader.ReadUInt32();
            Unused_01Ch        = reader.ReadUInt32();
            Transform          = reader.ReadMatrix();
            AABBSize           = reader.ReadVector3();
            AABBUnk            = reader.ReadUInt32();
            VerticesPointer    = reader.ReadUInt64();
            Unused_078h        = reader.ReadUInt32();
            Unused_07Ch        = reader.ReadUInt32();
            IndicesPointer     = reader.ReadUInt64();
            EdgesPointer       = reader.ReadUInt64();
            EdgesIndicesCount  = reader.ReadUInt32();
            AdjAreaIDs         = reader.ReadStruct <NavMeshUintArray>();
            PolysPointer       = reader.ReadUInt64();
            SectorTreePointer  = reader.ReadUInt64();
            PortalsPointer     = reader.ReadUInt64();
            PortalLinksPointer = reader.ReadUInt64();
            VerticesCount      = reader.ReadUInt32();
            PolysCount         = reader.ReadUInt32();
            AreaID             = reader.ReadUInt32();
            TotalBytes         = reader.ReadUInt32();
            PointsCount        = reader.ReadUInt32();
            PortalsCount       = reader.ReadUInt32();
            PortalLinksCount   = reader.ReadUInt32();
            Unused_154h        = reader.ReadUInt32();
            Unused_158h        = reader.ReadUInt32();
            Unused_15Ch        = reader.ReadUInt32();
            VersionUnk2        = reader.ReadUInt32();
            Unused_164h        = reader.ReadUInt32();
            Unused_168h        = reader.ReadUInt32();
            Unused_16Ch        = reader.ReadUInt32();



            Vertices    = reader.ReadBlockAt <NavMeshList <NavMeshVertex> >(VerticesPointer);
            Indices     = reader.ReadBlockAt <NavMeshList <ushort> >(IndicesPointer);
            Edges       = reader.ReadBlockAt <NavMeshList <NavMeshEdge> >(EdgesPointer);
            Polys       = reader.ReadBlockAt <NavMeshList <NavMeshPoly> >(PolysPointer);
            SectorTree  = reader.ReadBlockAt <NavMeshSector>(SectorTreePointer);
            Portals     = reader.ReadStructsAt <NavMeshPortal>(PortalsPointer, PortalsCount);
            PortalLinks = reader.ReadUshortsAt(PortalLinksPointer, PortalLinksCount);



            ////testing!
            //if (VersionUnk1 != 0x00010011)
            //{ }
            //if (Unused_018h != 0)
            //{ }
            //if (Unused_01Ch != 0)
            //{ }
            //if (AABBUnk != 0x7F800001)
            //{ }
            //if (Unused_078h != 0)
            //{ }
            //if (Unused_07Ch != 0)
            //{ }
            //if (Unused_154h != 0)
            //{ }
            //if (Unused_158h != 0)
            //{ }
            //if (Unused_15Ch != 0)
            //{ }
            //if (Unused_164h != 0)
            //{ }
            //if (Unused_168h != 0)
            //{ }
            //if (Unused_16Ch != 0)
            //{ }
            //switch (VersionUnk2.Hash)
            //{
            //    case 0: //vehicle
            //        break;
            //    case 0x85CB3561: //grid
            //        break;
            //    default:
            //        break;
            //}
            //UpdateCounts();
        }
Example #18
0
        public override void Read(ResourceDataReader reader, params object[] parameters)
        {
            // read structure data
            this.VFT            = reader.ReadUInt32();
            this.Unknown_4h     = reader.ReadUInt32();
            this.Unknown_8h     = reader.ReadUInt32();
            this.Unknown_Ch     = reader.ReadUInt32();
            this.Unknown_10h    = reader.ReadUInt32();
            this.Unknown_14h    = reader.ReadUInt32();
            this.Unknown_18h    = reader.ReadUInt32();
            this.Unknown_1Ch    = reader.ReadUInt32();
            this.Unknown_20h    = reader.ReadBlock <ResourcePointerList64 <ExpressionUnk1> >();
            this.BoneTracks     = reader.ReadBlock <ResourceSimpleList64_s <ExpressionBoneTrack> >();
            this.Unknown_40h    = reader.ReadBlock <ResourceSimpleList64 <ExpressionUnk2> >();
            this.Unknown_50h    = reader.ReadBlock <ResourceSimpleList64_s <MetaHash> >();
            this.NamePointer    = reader.ReadUInt64();
            this.NameLength     = reader.ReadUInt16();
            this.NameCapacity   = reader.ReadUInt16();
            this.Unknown_6Ch    = reader.ReadUInt32();
            this.Unknown_70h    = reader.ReadUInt32();
            this.Unknown_74h    = reader.ReadUInt32();
            this.Unk1ItemLength = reader.ReadUInt16();
            this.Unknown_7Ah    = reader.ReadUInt16();
            this.Unknown_7Ch    = reader.ReadUInt32();
            this.Unknown_80h    = reader.ReadUInt32();
            this.Unknown_84h    = reader.ReadUInt32();
            this.Unknown_88h    = reader.ReadUInt32();
            this.Unknown_8Ch    = reader.ReadUInt32();

            // read reference data
            this.Name = reader.ReadBlockAt <string_r>(
                this.NamePointer // offset
                );

            //if (Unknown_50h?.data_items?.Length > 0)
            //{ } // faceinit.expr, independent_mover.expr

            BuildBoneTracksDict();

            #region testing
            //long tlen = 0;
            //if (Unknown_20h?.data_items != null) foreach (var item in Unknown_20h.data_items) tlen = Math.Max(tlen, item.BlockLength);
            //if (Unk1ItemLength != tlen)
            //{ }//no hit

            //if (Unknown_4h != 1)
            //{ }//no hit
            //if (Unknown_8h != 0)
            //{ }//no hit
            //if (Unknown_Ch != 0)
            //{ }//no hit
            //if (Unknown_10h != 0)
            //{ }//no hit
            //if (Unknown_14h != 0)
            //{ }//no hit
            //if (Unknown_18h != 0)
            //{ }//no hit
            //if (Unknown_1Ch != 0)
            //{ }//no hit
            //if (NameLength != (Name?.Value?.Length ?? 0))
            //{ }//no hit
            //if (NameCapacity != (NameLength + 1))
            //{ }//no hit
            //if (Unknown_6Ch != 0)
            //{ }//no hit
            //if (Unknown_70h != 1)
            //{ }//no hit
            //switch (Unknown_74h)
            //{
            //    default:
            //        break;
            //}
            //if (Unknown_7Ah != 0)
            //{ }//no hit
            //switch (Unknown_7Ch)
            //{
            //    case 3:
            //    case 2:
            //        break;
            //    default:
            //        break;//no hit
            //}
            //if (Unknown_80h != 0)
            //{ }//no hit
            //if (Unknown_84h != 0)
            //{ }//no hit
            //if (Unknown_88h != 0)
            //{ }//no hit
            //if (Unknown_8Ch != 0)
            //{ }//no hit
            #endregion
        }
Example #19
0
        public override void Read(ResourceDataReader reader, params object[] parameters)
        {
            // read structure data
            this.VFT         = reader.ReadUInt32();
            this.Unknown_4h  = reader.ReadUInt32();
            this.Unknown_8h  = reader.ReadUInt32();
            this.Unknown_Ch  = reader.ReadUInt32();
            this.Unknown_10h = reader.ReadUInt32();
            this.Unknown_14h = reader.ReadUInt32();
            this.Unknown_18h = reader.ReadUInt32();
            this.Unknown_1Ch = reader.ReadUInt32();
            this.Unknown_20h = reader.ReadUInt32();
            this.Unknown_24h = reader.ReadUInt32();
            this.NamePointer = reader.ReadUInt64();
            this.Unknown_30h = reader.ReadUInt16();
            this.Unknown_32h = reader.ReadUInt16();
            this.Unknown_34h = reader.ReadUInt32();
            this.Unknown_38h = reader.ReadUInt32();
            this.Unknown_3Ch = reader.ReadUInt32();
            this.UsageData   = reader.ReadUInt32();
            this.Unknown_44h = reader.ReadUInt32();
            this.ExtraFlags  = reader.ReadUInt32();
            this.Unknown_4Ch = reader.ReadUInt32();



            // read reference data
            this.Name = reader.ReadStringAt( //BlockAt<string_r>(
                this.NamePointer             // offset
                );

            if (!string.IsNullOrEmpty(Name))
            {
                NameHash = JenkHash.GenHash(Name.ToLowerInvariant());
            }

            //switch (Unknown_32h)
            //{
            //    case 0x20:
            //    case 0x28:
            //    case 0x30:
            //    case 0x38:
            //    case 0x40:
            //    case 0x48:
            //    case 0x80:
            //    case 0x90:
            //    case 0x2://base/shaderparam
            //        break;
            //    default:
            //        break;//no hit
            //}

            //switch (Usage)
            //{
            //    case TextureUsage.UNKNOWN:// = 0,
            //    case TextureUsage.DEFAULT:// = 1,
            //    case TextureUsage.TERRAIN:// = 2,
            //    case TextureUsage.CLOUDDENSITY:// = 3,
            //    case TextureUsage.CLOUDNORMAL:// = 4,
            //    case TextureUsage.CABLE:// = 5,
            //    case TextureUsage.FENCE:// = 6,
            //    case TextureUsage.SCRIPT:// = 8,
            //    case TextureUsage.WATERFLOW:// = 9,
            //    case TextureUsage.WATERFOAM:// = 10,
            //    case TextureUsage.WATERFOG:// = 11,
            //    case TextureUsage.WATEROCEAN:// = 12,
            //    case TextureUsage.FOAMOPACITY:// = 14,
            //    case TextureUsage.DIFFUSEMIPSHARPEN:// = 16,
            //    case TextureUsage.DIFFUSEDARK:// = 18,
            //    case TextureUsage.DIFFUSEALPHAOPAQUE:// = 19,
            //    case TextureUsage.DIFFUSE:// = 20,
            //    case TextureUsage.DETAIL:// = 21,
            //    case TextureUsage.NORMAL:// = 22,
            //    case TextureUsage.SPECULAR:// = 23,
            //    case TextureUsage.EMISSIVE:// = 24,
            //    case TextureUsage.TINTPALETTE:// = 25,
            //    case TextureUsage.SKIPPROCESSING:// = 26,
            //        break;
            //    case TextureUsage.ENVEFF:// = 7, //unused by V
            //    case TextureUsage.WATER:// = 13, //unused by V
            //    case TextureUsage.FOAM:// = 15,  //unused by V
            //    case TextureUsage.DIFFUSEDETAIL:// = 17, //unused by V
            //    case TextureUsage.DONOTOPTIMIZE:// = 27, //unused by V
            //    case TextureUsage.TEST:// = 28,  //unused by V
            //    case TextureUsage.COUNT:// = 29, //unused by V
            //        break;//no hit
            //    default:
            //        break;//no hit
            //}

            //var uf = UsageFlags;
            //if ((uf & TextureUsageFlags.EMBEDDEDSCRIPTRT) > 0) // .ydr embedded script_rt textures, only 3 uses
            //{ }
            //if ((uf & TextureUsageFlags.UNK19) > 0)
            //{ }//no hit
            //if ((uf & TextureUsageFlags.UNK20) > 0)
            //{ }//no hit
            //if ((uf & TextureUsageFlags.UNK21) > 0)
            //{ }//no hit
            //if ((uf & TextureUsageFlags.UNK24) == 0)//wtf isthis? only 0 on special resident(?) textures and some reused ones
            //{ }

            //if (!(this is Texture))
            //{
            //    if (Unknown_32h != 0x2)//base/shaderparam
            //    { }//no hit
            //    if (UsageData != 0)
            //    { }//no hit
            //    if (Unknown_44h != 0)
            //    { }//no hit
            //    if (ExtraFlags != 0)
            //    { }//no hit
            //    if (Unknown_4Ch != 0)
            //    { }//no hit
            //}
        }
Example #20
0
        public override void Read(ResourceDataReader reader, params object[] parameters)
        {
            base.Read(reader, parameters);

            // read structure data
            this.UsageData   = reader.ReadUInt32();
            this.Unknown_44h = reader.ReadUInt32();
            this.ExtraFlags  = reader.ReadUInt32();
            this.Unknown_4Ch = reader.ReadUInt32();
            this.Width       = reader.ReadUInt16();
            this.Height      = reader.ReadUInt16();
            this.Depth       = reader.ReadUInt16();
            this.Stride      = reader.ReadUInt16();
            this.Format      = (TextureFormat)reader.ReadUInt32();
            this.Unknown_5Ch = reader.ReadByte();
            this.Levels      = reader.ReadByte();
            this.Unknown_5Eh = reader.ReadUInt16();
            this.Unknown_60h = reader.ReadUInt32();
            this.Unknown_64h = reader.ReadUInt32();
            this.Unknown_68h = reader.ReadUInt32();
            this.Unknown_6Ch = reader.ReadUInt32();
            this.DataPointer = reader.ReadUInt64();
            this.Unknown_78h = reader.ReadUInt32();
            this.Unknown_7Ch = reader.ReadUInt32();
            this.Unknown_80h = reader.ReadUInt32();
            this.Unknown_84h = reader.ReadUInt32();
            this.Unknown_88h = reader.ReadUInt32();
            this.Unknown_8Ch = reader.ReadUInt32();

            // read reference data
            this.Data = reader.ReadBlockAt <TextureData>(this.DataPointer, this.Format, this.Width, this.Height, this.Levels, this.Stride);


            switch (Usage)
            {
            case TextureUsage.UNKNOWN:            // = 0,
            case TextureUsage.DEFAULT:            // = 1,
            case TextureUsage.TERRAIN:            // = 2,
            case TextureUsage.CLOUDDENSITY:       // = 3,
            case TextureUsage.CLOUDNORMAL:        // = 4,
            case TextureUsage.CABLE:              // = 5,
            case TextureUsage.FENCE:              // = 6,
            case TextureUsage.SCRIPT:             // = 8,
            case TextureUsage.WATERFLOW:          // = 9,
            case TextureUsage.WATERFOAM:          // = 10,
            case TextureUsage.WATERFOG:           // = 11,
            case TextureUsage.WATEROCEAN:         // = 12,
            case TextureUsage.FOAMOPACITY:        // = 14,
            case TextureUsage.DIFFUSEMIPSHARPEN:  // = 16,
            case TextureUsage.DIFFUSEDARK:        // = 18,
            case TextureUsage.DIFFUSEALPHAOPAQUE: // = 19,
            case TextureUsage.DIFFUSE:            // = 20,
            case TextureUsage.DETAIL:             // = 21,
            case TextureUsage.NORMAL:             // = 22,
            case TextureUsage.SPECULAR:           // = 23,
            case TextureUsage.EMISSIVE:           // = 24,
            case TextureUsage.TINTPALETTE:        // = 25,
            case TextureUsage.SKIPPROCESSING:     // = 26,
                break;

            case TextureUsage.ENVEFF:        // = 7, //unused by V
            case TextureUsage.WATER:         // = 13, //unused by V
            case TextureUsage.FOAM:          // = 15,  //unused by V
            case TextureUsage.DIFFUSEDETAIL: // = 17, //unused by V
            case TextureUsage.DONOTOPTIMIZE: // = 27, //unused by V
            case TextureUsage.TEST:          // = 28,  //unused by V
            case TextureUsage.COUNT:         // = 29, //unused by V
                break;

            default:
                break;
            }

            var uf = UsageFlags;

            if ((uf & TextureUsageFlags.EMBEDDEDSCRIPTRT) > 0) // .ydr embedded script_rt textures, only 3 uses
            {
            }
            if ((uf & TextureUsageFlags.UNK19) > 0)
            {
            }
            if ((uf & TextureUsageFlags.UNK20) > 0)
            {
            }
            if ((uf & TextureUsageFlags.UNK21) > 0)
            {
            }
            if ((uf & TextureUsageFlags.UNK24) == 0)//wtf isthis? only 0 on special resident(?) textures and some reused ones
            {
            }
        }