예제 #1
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());
            }
        }
예제 #2
0
파일: Meta.cs 프로젝트: z87/CodeWalker
        /// <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.ReadInt32();
            this.Unknown_14h           = reader.ReadInt16();
            this.HasUselessData        = reader.ReadByte();
            this.Unknown_17h           = reader.ReadByte();
            this.Unknown_18h           = reader.ReadInt32();
            this.RootBlockIndex        = reader.ReadInt32();
            this.StructureInfosPointer = reader.ReadInt64();
            this.EnumInfosPointer      = reader.ReadInt64();
            this.DataBlocksPointer     = reader.ReadInt64();
            this.NamePointer           = reader.ReadInt64();
            this.UselessPointer        = reader.ReadInt64();
            this.StructureInfosCount   = reader.ReadInt16();
            this.EnumInfosCount        = reader.ReadInt16();
            this.DataBlocksCount       = reader.ReadInt16();
            this.Unknown_4Eh           = reader.ReadInt16();
            this.Unknown_50h           = reader.ReadUInt32();
            this.Unknown_54h           = reader.ReadUInt32();
            this.Unknown_58h           = reader.ReadUInt32();
            this.Unknown_5Ch           = reader.ReadUInt32();
            this.Unknown_60h           = reader.ReadUInt32();
            this.Unknown_64h           = reader.ReadUInt32();
            this.Unknown_68h           = reader.ReadUInt32();
            this.Unknown_6Ch           = reader.ReadUInt32();

            // read reference data
            this.StructureInfos = reader.ReadBlockAt <ResourceSimpleArray <MetaStructureInfo> >(
                (ulong)this.StructureInfosPointer, // offset
                this.StructureInfosCount
                );

            this.EnumInfos = reader.ReadBlockAt <ResourceSimpleArray <MetaEnumInfo> >(
                (ulong)this.EnumInfosPointer, // offset
                this.EnumInfosCount
                );

            this.DataBlocks = reader.ReadBlockAt <ResourceSimpleArray <MetaDataBlock> >(
                (ulong)this.DataBlocksPointer, // offset
                this.DataBlocksCount
                );

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

            if (!string.IsNullOrEmpty(Name))
            {
            }

            //Strings = MetaTypes.GetStrings(this);
        }
예제 #3
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;
            }
        }
예제 #4
0
파일: Texture.cs 프로젝트: q4a/CodeWalker
        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
            //}
        }