protected override Stream UnParse() { Stream s = new MemoryStream(); var bw = new BinaryWriter(s); bw.Write(mVersion); var keys = new ResourceKeyTable(); long startPos = keys.BeginWrite(s); if (mShaderKeyList == null) { mShaderKeyList = new ShaderKeyList(OnResourceChanged); } mShaderKeyList.UnParse(s); if (mSkinSubSRampKey == null) { mSkinSubSRampKey = new TGIBlock(0, OnResourceChanged); } if (mToneRampKey == null) { mToneRampKey = new TGIBlock(0, OnResourceChanged); } bw.Write(keys.Add(mSkinSubSRampKey)); bw.Write(keys.Add(mToneRampKey)); if (mTextureKeyList == null) { mTextureKeyList = new TextureKeyList(OnResourceChanged, this); } mTextureKeyList.UnParse(s, keys); bw.Write(mIsDominant ? (byte)1 : (byte)0); keys.EndWrite(s, startPos); return(s); }
protected override Stream UnParse() { Stream s = new MemoryStream(); var bw = new BinaryWriter(s); bw.Write(mVersion); if (mShaderKeyList == null) { mShaderKeyList = new ShaderKeyList(OnResourceChanged); } mShaderKeyList.UnParse(s); bw.Write(mIsDominant); return(s); }