diff --git a/Content.Client/Parallax/ParallaxGenerator.cs b/Content.Client/Parallax/ParallaxGenerator.cs index 5d2b6046a3..88b7616f13 100644 --- a/Content.Client/Parallax/ParallaxGenerator.cs +++ b/Content.Client/Parallax/ParallaxGenerator.cs @@ -6,6 +6,7 @@ using SixLabors.ImageSharp; using SixLabors.ImageSharp.PixelFormats; using SixLabors.Primitives; using Robust.Client.Utility; +using Robust.Shared.Interfaces.Log; using Robust.Shared.Log; using Robust.Shared.Maths; using Robust.Shared.Noise; @@ -17,9 +18,9 @@ namespace Content.Client.Parallax { private readonly List Layers = new List(); - public static Image GenerateParallax(TomlTable config, Size size) + public static Image GenerateParallax(TomlTable config, Size size, ISawmill sawmill) { - Logger.DebugS("parallax", "Generating parallax!"); + sawmill.Debug("Generating parallax!"); var generator = new ParallaxGenerator(); generator._loadConfig(config); @@ -28,7 +29,7 @@ namespace Content.Client.Parallax foreach (var layer in generator.Layers) { layer.Apply(image); - Logger.DebugS("parallax", "Layer {0} done!", count++); + sawmill.Debug("Layer {0} done!", count++); } return image; diff --git a/Content.Client/Parallax/ParallaxManager.cs b/Content.Client/Parallax/ParallaxManager.cs index f9cb241958..0c33a5b2bd 100644 --- a/Content.Client/Parallax/ParallaxManager.cs +++ b/Content.Client/Parallax/ParallaxManager.cs @@ -9,6 +9,7 @@ using SixLabors.ImageSharp; using SixLabors.Primitives; using Robust.Client.Graphics; using Robust.Client.Interfaces.ResourceManagement; +using Robust.Shared.Interfaces.Log; using Robust.Shared.IoC; using Robust.Shared.Log; using Robust.Shared.Utility; @@ -19,6 +20,7 @@ namespace Content.Client.Parallax { #pragma warning disable 649 [Dependency] private readonly IResourceCache _resourceCache; + [Dependency] private readonly ILogManager _logManager; #pragma warning restore 649 private static readonly ResourcePath ParallaxConfigPath = new ResourcePath("/parallax_config.toml"); @@ -77,8 +79,9 @@ namespace Content.Client.Parallax configStream?.Dispose(); } + var sawmill = _logManager.GetSawmill("parallax"); // Generate the parallax in the thread pool. - var image = await Task.Run(() => ParallaxGenerator.GenerateParallax(table, new Size(1920, 1080))); + var image = await Task.Run(() => ParallaxGenerator.GenerateParallax(table, new Size(1920, 1080), sawmill)); // And load it in the main thread for safety reasons. ParallaxTexture = Texture.LoadFromImage(image, "Parallax");