Beispiel #1
0
        internal static StandingWaterArea Parse(BinaryReader reader)
        {
            var result = new StandingWaterArea
            {
                UniqueID            = reader.ReadUInt32(),
                Name                = reader.ReadUInt16PrefixedAsciiString(),
                LayerName           = reader.ReadUInt16PrefixedAsciiString(),
                UvScrollSpeed       = reader.ReadSingle(),
                UseAdditiveBlending = reader.ReadBooleanChecked(),
                BumpMapTexture      = reader.ReadUInt16PrefixedAsciiString(),
                SkyTexture          = reader.ReadUInt16PrefixedAsciiString(),
            };

            var numPoints = reader.ReadUInt32();

            result.Points = new Vector2[numPoints];

            for (var i = 0; i < numPoints; i++)
            {
                result.Points[i] = reader.ReadVector2();
            }

            result.WaterHeight = reader.ReadUInt32();
            result.FxShader    = reader.ReadUInt16PrefixedAsciiString();
            result.DepthColors = reader.ReadUInt16PrefixedAsciiString();

            return(result);
        }
Beispiel #2
0
        internal static StandingWaterAreas Parse(BinaryReader reader, MapParseContext context)
        {
            return(ParseAsset(reader, context, version =>
            {
                var numAreas = reader.ReadUInt32();
                var areas = new StandingWaterArea[numAreas];

                for (var i = 0; i < numAreas; i++)
                {
                    areas[i] = StandingWaterArea.Parse(reader);
                }

                return new StandingWaterAreas
                {
                    Areas = areas
                };
            }));
        }