Esempio n. 1
0
 public TwinShader()
 {
     FloatParam   = new float[4];
     bitfieldData = new byte[30];
     UnkVector1   = new Vector4();
     UnkVector2   = new Vector4();
     UnkVector3   = new Vector4();
     Blob         = null;
 }
Esempio 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);
            }
        }