예제 #1
0
        private void readValueArray(BinaryReader br)
        {
            if (ValueLength == 0)
            {
                return;
            }

            Value[] Values = new Value[ArrayCount];

            for (int i = 0; i < ArrayCount; i++)
            {
                switch (Type)
                {
                case ShaderParameterType.@int:
                    Values[i] = new ValueInt(br);
                    break;

                case ShaderParameterType.@float:
                    Values[i] = new ValueFloat(br);
                    break;

                case ShaderParameterType.float2:
                    Values[i] = new ValueFloat2(br);
                    break;

                case ShaderParameterType.float3:
                    Values[i] = new ValueFloat3(br);
                    break;

                case ShaderParameterType.float4:
                    Values[i] = new ValueFloat4(br);
                    break;

                case ShaderParameterType.@bool:
                    Values[i] = new ValueBool(br);
                    break;

                case ShaderParameterType.float4x3:
                    Values[i] = new ValueFloat4x3(br);
                    break;

                case ShaderParameterType.float4x4:
                    Values[i] = new ValueFloat4x4(br);
                    break;

                case ShaderParameterType.sampler:
                    int len = ValueLength / ArrayCount;
                    Values[i] = new ValueSamplerState(br, len);
                    break;
                }
            }
            Value = new ValueList(Values);
        }
예제 #2
0
        private void readValue(BinaryReader br)
        {
            if (ValueLength == 0)
            {
                return;
            }

            switch (Type)
            {
            case ShaderParameterType.@int:
                Value = new ValueInt(br);
                break;

            case ShaderParameterType.@float:
                Value = new ValueFloat(br);
                break;

            case ShaderParameterType.float2:
                Value = new ValueFloat2(br);
                break;

            case ShaderParameterType.float3:
                Value = new ValueFloat3(br);
                break;

            case ShaderParameterType.float4:
                Value = new ValueFloat4(br);
                break;

            case ShaderParameterType.@bool:
                Value = new ValueBool(br);
                break;

            case ShaderParameterType.float4x3:
                Value = new ValueFloat4x3(br);
                break;

            case ShaderParameterType.float4x4:
                Value = new ValueFloat4x4(br);
                break;

            case ShaderParameterType.sampler:
                Value = new ValueSamplerState(br, ValueLength);
                break;
            }
        }