public bool Write(DAIIO io, bool skiplength = false) { try { if (!skiplength) { io.WriteBits(Length, LengthBits); } io.WriteBits(ParamCount, 0x10); if (TextureShaderParams == null) { TextureShaderParams = new TextureShaderParam[ParamCount]; for (int xb = 0; xb < ParamCount; xb++) { TextureShaderParams[xb] = new TextureShaderParam(); } } for (int i = 0; i < ParamCount; i++) { TextureShaderParams[i].Write(io); } return(true); } catch (Exception) { return(false); } }
public TextureShader Read(DAIIO io) { xLength = io.ReadBit2(LengthBits); ParamCount = (short)io.ReadBit2(0x10); TextureShaderParams = new TextureShaderParam[ParamCount]; for (int i = 0; i < ParamCount; i++) { TextureShaderParams[i] = new TextureShaderParam().Read(io); } return(this); }