From: The Grand Dog Date: Fri, 19 Jun 2020 15:16:24 +0000 (-0400) Subject: nope this fixed it! X-Git-Url: http://git.osdn.net/view?p=automap%2Fautomap.git;a=commitdiff_plain;h=refs%2Fheads%2Fvgd nope this fixed it! --- diff --git a/Automap/Subsystems/Snapshot.cs b/Automap/Subsystems/Snapshot.cs index 22ce8cd..3c2eea0 100644 --- a/Automap/Subsystems/Snapshot.cs +++ b/Automap/Subsystems/Snapshot.cs @@ -8,6 +8,7 @@ using System.Threading.Tasks; using Hjg.Pngcs; using Hjg.Pngcs.Chunks; +using Vintagestory.API.Common; namespace Automap { @@ -26,7 +27,7 @@ namespace Automap public Snapshotter(string path, ColumnsMetadata cols, int chunkSize, int worldSeed) { - this.fileName = Path.Combine(path, $"snapshot_{worldSeed}_{DateTime.UtcNow:u}.png"); + this.fileName = Path.Combine(path, $"snapshot_{worldSeed}.png"); this.chunkPath = Path.Combine(path, AutomapSystem._chunkPath); this.cols = cols; this.chunkSize = chunkSize; @@ -35,19 +36,13 @@ namespace Automap /// /// takes a snapshot. this should be called from an extra thread. /// - /// path to the map dir - /// name of the chunks dir part thing - /// - /// public async void Take() { - var t = new Stopwatch(); - t.Start(); - - Console.WriteLine("snapshot started"); ImageInfo info = new ImageInfo(Width * chunkSize, Height * chunkSize, 8, false); + PngWriter snapWriter = FileHelper.CreatePngWriter(fileName, info, true); + PngMetadata meta = snapWriter.GetMetadata( ); meta.SetTimeNow( ); var transparencyChunk = meta.CreateTRNSChunk( ); @@ -115,7 +110,6 @@ namespace Automap { Console.WriteLine("Snapshot exception!"); } - Console.WriteLine($"snapshot finished in {t.ElapsedMilliseconds}"); } private async Task> ReadAllInGroup(IGrouping group)