예제 #1
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);
        }
예제 #2
0
        /// <summary>
        /// Reads the data-block from a stream.
        /// </summary>
        public override void Read(ResourceDataReader reader, params object[] parameters)
        {
            // read structure data
            this.StructureNameHash = (MetaName)reader.ReadInt32();
            this.StructureKey      = reader.ReadUInt32();
            this.Unknown_8h        = reader.ReadUInt32();
            this.Unknown_Ch        = reader.ReadUInt32();
            this.EntriesPointer    = reader.ReadInt64();
            this.StructureSize     = reader.ReadInt32();
            this.Unknown_1Ch       = reader.ReadInt16();
            this.EntriesCount      = reader.ReadInt16();

            // read reference data
            this.Entries = reader.ReadStructsAt <MetaStructureEntryInfo_s>((ulong)this.EntriesPointer, (uint)this.EntriesCount);
        }
예제 #3
0
 public override void Read(ResourceDataReader reader, params object[] parameters)
 {
     // read structure data
     this.Time            = reader.ReadUInt32();
     this.VelocityX       = reader.ReadInt16();
     this.VelocityY       = reader.ReadInt16();
     this.VelocityZ       = reader.ReadInt16();
     this.RightX          = (sbyte)reader.ReadByte();
     this.RightY          = (sbyte)reader.ReadByte();
     this.RightZ          = (sbyte)reader.ReadByte();
     this.ForwardX        = (sbyte)reader.ReadByte();
     this.ForwardY        = (sbyte)reader.ReadByte();
     this.ForwardZ        = (sbyte)reader.ReadByte();
     this.SteeringAngle   = (sbyte)reader.ReadByte();
     this.GasPedalPower   = (sbyte)reader.ReadByte();
     this.BrakePedalPower = (sbyte)reader.ReadByte();
     this.HandbrakeUsed   = reader.ReadByte();
     this.Position        = reader.ReadVector3();
 }