internal static W3dShader Parse(BinaryReader reader) { var result = new W3dShader { DepthCompare = reader.ReadByteAsEnum <W3dShaderDepthCompare>(), DepthMask = reader.ReadByteAsEnum <W3dShaderDepthMask>(), ColorMask = reader.ReadByte(), DestBlend = reader.ReadByteAsEnum <W3dShaderDestBlendFunc>(), FogFunc = reader.ReadByte(), PrimaryGradient = reader.ReadByteAsEnum <W3dShaderPrimaryGradient>(), SecondaryGradient = reader.ReadByteAsEnum <W3dShaderSecondaryGradient>(), SrcBlend = reader.ReadByteAsEnum <W3dShaderSrcBlendFunc>(), Texturing = reader.ReadByteAsEnum <W3dShaderTexturing>(), DetailColorFunc = reader.ReadByteAsEnum <W3dShaderDetailColorFunc>(), DetailAlphaFunc = reader.ReadByteAsEnum <W3dShaderDetailAlphaFunc>(), ShaderPreset = reader.ReadByte(), AlphaTest = reader.ReadByteAsEnum <W3dShaderAlphaTest>(), PostDetailColorFunc = reader.ReadByteAsEnum <W3dShaderDetailColorFunc>(), PostDetailAlphaFunc = reader.ReadByteAsEnum <W3dShaderDetailAlphaFunc>() }; reader.ReadByte(); // padding return(result); }
internal static W3dEmitterInfoV2 Parse(BinaryReader reader, W3dParseContext context) { return(ParseChunk(reader, context, header => { var result = new W3dEmitterInfoV2 { BurstSize = reader.ReadUInt32(), CreationVolume = W3dVolumeRandomizer.Parse(reader), VelRandom = W3dVolumeRandomizer.Parse(reader), OutwardVel = reader.ReadSingle(), VelInherit = reader.ReadSingle(), Shader = W3dShader.Parse(reader), RenderMode = reader.ReadUInt32AsEnum <W3dEmitterRenderMode>(), FrameMode = reader.ReadUInt32AsEnum <W3dEmitterFrameMode>() }; reader.ReadBytes(6 * sizeof(uint)); // Pad return result; })); }