From 97973c3e78ad91681ce8a367495acdfa40f641df Mon Sep 17 00:00:00 2001 From: Exp Date: Sat, 28 Nov 2020 02:36:06 +0100 Subject: [PATCH] Fix ParallaxGenerator dying (#2637) --- Content.Client/Parallax/ParallaxGenerator.cs | 22 ++++++++++---------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/Content.Client/Parallax/ParallaxGenerator.cs b/Content.Client/Parallax/ParallaxGenerator.cs index d1c182910b..4c057b322b 100644 --- a/Content.Client/Parallax/ParallaxGenerator.cs +++ b/Content.Client/Parallax/ParallaxGenerator.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.Diagnostics; using System.Globalization; @@ -27,7 +27,7 @@ namespace Content.Client.Parallax sawmill.Debug("Timing start!"); var sw = new Stopwatch(); sw.Start(); - var image = new Image(Configuration.Default, size.Width, size.Height, new Rgba32(0,0,0,255)); + var image = new Image(Configuration.Default, size.Width, size.Height, new Rgba32(0, 0, 0, 255)); var count = 0; foreach (var layer in generator.Layers) { @@ -44,7 +44,7 @@ namespace Content.Client.Parallax private void _loadConfig(TomlTable config) { - foreach (var layerArray in ((TomlTableArray)config.Get("layers")).Items) + foreach (var layerArray in ((TomlTableArray) config.Get("layers")).Items) { switch (((TomlValue) layerArray.Get("type")).Value) { @@ -98,7 +98,7 @@ namespace Content.Client.Parallax if (table.TryGetValue("seed", out tomlObject)) { - Seed = (uint) ((TomlValue) tomlObject).Value; + Seed = (uint) ((TomlValue) tomlObject).Value; } if (table.TryGetValue("persistence", out tomlObject)) @@ -118,7 +118,7 @@ namespace Content.Client.Parallax if (table.TryGetValue("octaves", out tomlObject)) { - Octaves = (uint) ((TomlValue) tomlObject).Value; + Octaves = (uint) ((TomlValue) tomlObject).Value; } if (table.TryGetValue("threshold", out tomlObject)) @@ -225,12 +225,12 @@ namespace Content.Client.Parallax { if (table.TryGetValue("seed", out var tomlObject)) { - Seed = ((TomlValue) tomlObject).Value; + Seed = (int) ((TomlValue) tomlObject).Value; } if (table.TryGetValue("count", out tomlObject)) { - PointCount = ((TomlValue) tomlObject).Value; + PointCount = (int) ((TomlValue) tomlObject).Value; } if (table.TryGetValue("sourcefactor", out tomlObject)) @@ -255,7 +255,7 @@ namespace Content.Client.Parallax if (table.TryGetValue("pointsize", out tomlObject)) { - PointSize = ((TomlValue) tomlObject).Value; + PointSize = (int) ((TomlValue) tomlObject).Value; } // Noise mask stuff. @@ -266,7 +266,7 @@ namespace Content.Client.Parallax if (table.TryGetValue("maskseed", out tomlObject)) { - MaskSeed = (uint) ((TomlValue) tomlObject).Value; + MaskSeed = (uint) ((TomlValue) tomlObject).Value; } if (table.TryGetValue("maskpersistence", out tomlObject)) @@ -286,7 +286,7 @@ namespace Content.Client.Parallax if (table.TryGetValue("maskoctaves", out tomlObject)) { - MaskOctaves = (uint) ((TomlValue) tomlObject).Value; + MaskOctaves = (uint) ((TomlValue) tomlObject).Value; } if (table.TryGetValue("maskthreshold", out tomlObject)) @@ -318,7 +318,7 @@ namespace Content.Client.Parallax public override void Apply(Image bitmap) { // Temporary buffer so we don't mess up blending. - using (var buffer = new Image(Configuration.Default, bitmap.Width, bitmap.Height, new Rgba32(0,0,0,0))) + using (var buffer = new Image(Configuration.Default, bitmap.Width, bitmap.Height, new Rgba32(0, 0, 0, 0))) { if (Masked) {