Esempio n. 1
0
        public bool Write(DAIIO io, bool skiplength = false)
        {
            try
            {
                if (!skiplength)
                {
                    io.WriteBits(Length, LengthBits);
                }
                io.WriteBits(ParamCount, 0x10);
                if (VectorShaderParams == null)
                {
                    VectorShaderParams = new VectorShaderParam[ParamCount];

                    for (int xb = 0; xb < ParamCount; xb++)
                    {
                        VectorShaderParams[xb] = new VectorShaderParam();
                    }
                }
                for (int i = 0; i < ParamCount; i++)
                {
                    VectorShaderParams[i].Write(io);
                }

                return(true);
            }
            catch (Exception)
            {
                return(false);
            }
        }
Esempio n. 2
0
 public VectorShader Read(DAIIO io)
 {
     xLength            = io.ReadBit2(LengthBits);
     ParamCount         = (short)io.ReadBit2(0x10);
     VectorShaderParams = new VectorShaderParam[ParamCount];
     for (int i = 0; i < ParamCount; i++)
     {
         VectorShaderParams[i] = new VectorShaderParam().Read(io);
     }
     return(this);
 }