public override void Read(EndianBinaryReader reader, ISection section = null) { var paramReader = new ParameterReader(reader); while (paramReader.Read()) { switch (paramReader.HeadToken) { case "exposure": Exposure = paramReader.ReadSingle(); break; case "gamma": Gamma = paramReader.ReadSingle(); break; case "saturate_power": SaturatePower = paramReader.ReadUInt32(); break; case "saturate_coef": SaturateCoefficient = paramReader.ReadSingle(); break; case "flare": FlarePower = paramReader.ReadSingle(); FlareShaft = paramReader.ReadSingle(); FlareGhost = paramReader.ReadSingle(); break; case "sigma": GlareRadius = paramReader.ReadVector3(); break; case "intensity": GlareIntensity = paramReader.ReadVector3(); break; case "auto_exposure": AutoExposure = paramReader.ReadBoolean(); break; case "tone_map_type": ToneMapType = ( ToneMapType )paramReader.ReadInt32(); break; case "fade_color": FadeColor = paramReader.ReadVector3(); FadeBlendFunc = ( FadeBlendFunc )paramReader.ReadInt32(); break; case "tone_transform": ToneTransStart = paramReader.ReadVector3(); ToneTransEnd = paramReader.ReadVector3(); break; } } }
public override void Read(EndianBinaryReader reader, ISection section = null) { var paramReader = new ParameterReader(reader); while (paramReader.Read()) { switch (paramReader.HeadToken) { case "scale": Scale = paramReader.ReadSingle(); break; case "cycle": Cycle = paramReader.ReadSingle(); break; case "rot": Rotation = paramReader.ReadVector2(); break; case "bias": Bias = paramReader.ReadSingle(); break; case "spc": Spc[paramReader.ReadInt32()] = paramReader.ReadVector2(); break; } } }
internal void Read(ParameterReader paramReader) { while (paramReader.Read()) { switch (paramReader.HeadToken) { case "id_start": { var light = new Light { Id = ( LightId )paramReader.ReadInt32() }; { light.Read(paramReader); } Lights.Add(light); break; } case "group_start": throw new InvalidDataException("Expected group end before group start"); case "group_end": if (paramReader.ReadUInt32() != Id) { throw new InvalidDataException($"Expected group end with id {Id}"); } return; } } }
internal void Read(ParameterReader paramReader) { while (paramReader.Read()) { switch (paramReader.HeadToken) { case "type": Type = ( FogType )paramReader.ReadInt32(); break; case "density": Density = paramReader.ReadSingle(); break; case "linear": Start = paramReader.ReadSingle(); End = paramReader.ReadSingle(); break; case "color": Color = paramReader.ReadVector4(); break; case "group_start": throw new InvalidDataException("Expected group end before group start"); case "group_end": if (paramReader.ReadUInt32() != Id) { throw new InvalidDataException($"Expected group end with id {Id}"); } return; } } }
internal void Read(ParameterReader paramReader) { while (paramReader.Read()) { switch (paramReader.HeadToken) { case "type": Type = ( LightType )paramReader.ReadInt32(); break; case "ambient": Ambient = paramReader.ReadVector4(); break; case "diffuse": Diffuse = paramReader.ReadVector4(); break; case "specular": Specular = paramReader.ReadVector4(); break; case "position": Position = paramReader.ReadVector4(); break; case "spot_direction": SpotDirection = paramReader.ReadVector3(); break; case "spot_exponent": SpotExponent = paramReader.ReadSingle(); break; case "spot_cutoff": SpotCutoff = paramReader.ReadSingle(); break; case "attenuation": SpotAttenuationConstant = paramReader.ReadSingle(); SpotAttenuationLinear = paramReader.ReadSingle(); SpotAttenuationQuadratic = paramReader.ReadSingle(); break; case "clipplane": ClipPlane = paramReader.ReadVector4(); break; case "tonecurve": ToneCurve = paramReader.ReadVector3(); break; case "id_end": if (paramReader.ReadInt32() != ( int )Id) { throw new InvalidDataException($"Expected id end with id {( int ) Id}"); } return; } } }