Ejemplo n.º 1
0
        public void Read(BinaryReader reader, int length)
        {
            CamTrigger.Header1 = reader.ReadUInt32();
            CamTrigger.Enabled = reader.ReadUInt32();
            CamTrigger.HeaderT = reader.ReadSingle();
            CamTrigger.Rotation.Read(reader, Constants.SIZE_VECTOR4);
            CamTrigger.Position.Read(reader, Constants.SIZE_VECTOR4);
            CamTrigger.Scale.Read(reader, Constants.SIZE_VECTOR4);
            reader.ReadUInt32();
            UInt32 instances_cnt = reader.ReadUInt32();

            CamTrigger.HeaderH = reader.ReadUInt32();
            CamTrigger.Instances.Clear();
            for (int i = 0; i < instances_cnt; ++i)
            {
                CamTrigger.Instances.Add(reader.ReadUInt16());
            }
            // Camera
            CameraHeader = reader.ReadUInt32();
            UnkShort     = reader.ReadUInt16();
            UnkFloat1    = reader.ReadSingle();
            UnkVector1.Read(reader, Constants.SIZE_VECTOR4);
            UnkVector2.Read(reader, Constants.SIZE_VECTOR4);
            UnkFloat2  = reader.ReadSingle();
            UnkFloat3  = reader.ReadSingle();
            UnkInt1    = reader.ReadUInt32();
            UnkInt2    = reader.ReadUInt32();
            UnkInt3    = reader.ReadUInt32();
            UnkInt4    = reader.ReadUInt32();
            UnkInt5    = reader.ReadUInt32();
            UnkInt6    = reader.ReadUInt32();
            UnkFloat4  = reader.ReadSingle();
            UnkFloat5  = reader.ReadSingle();
            UnkFloat6  = reader.ReadSingle();
            UnkFloat7  = reader.ReadSingle();
            UnkInt7    = reader.ReadUInt32();
            UnkInt8    = reader.ReadUInt32();
            UnkInt9    = reader.ReadUInt32();
            UnkFloat8  = reader.ReadSingle();
            TypeIndex1 = reader.ReadUInt32();
            TypeIndex2 = reader.ReadUInt32();
            UnkByte    = reader.ReadByte();
            if (TypeIndex1 != 3 && subCamIdToCamera.ContainsKey(TypeIndex1))
            {
                MainCamera1 = (CameraSubBase)Activator.CreateInstance(subCamIdToCamera[TypeIndex1]);
                MainCamera1.Read(reader, MainCamera1.GetLength());
            }
            if (TypeIndex2 != 3 && subCamIdToCamera.ContainsKey(TypeIndex2))
            {
                MainCamera2 = (CameraSubBase)Activator.CreateInstance(subCamIdToCamera[TypeIndex2]);
                MainCamera2.Read(reader, MainCamera2.GetLength());
            }
        }
Ejemplo n.º 2
0
        public void Read(BinaryReader reader, int length)
        {
            ShaderType = reader.ReadUInt32();
            switch (ShaderType)
            {
            case 23:
                IntParam      = reader.ReadUInt32();
                FloatParam[0] = reader.ReadSingle();
                FloatParam[1] = reader.ReadSingle();
                break;

            case 26:
                IntParam      = reader.ReadUInt32();
                FloatParam[0] = reader.ReadSingle();
                FloatParam[1] = reader.ReadSingle();
                FloatParam[2] = reader.ReadSingle();
                FloatParam[3] = reader.ReadSingle();
                break;

            case 16:
            case 17:
                FloatParam[0] = reader.ReadSingle();
                break;

            default:
                break;
            }
            reader.Read(bitfieldData, 0, bitfieldData.Length);
            //bitfield = reader.ReadUInt64();
            UnkShort1 = reader.ReadUInt16();
            UnkShort2 = reader.ReadUInt16();
            UnkVector1.Read(reader, Constants.SIZE_VECTOR4);
            UnkVector2.Read(reader, Constants.SIZE_VECTOR4);
            UnkVector3.Read(reader, Constants.SIZE_VECTOR4);
            TextureId = reader.ReadUInt32();
            UnkInt2   = reader.ReadUInt32();
            if (bitfieldData[29] != 0)
            {
                Blob = new TwinBlob();
                Blob.Read(reader, 0);
            }
        }