Automap (OSS) GIT software repository
Revisión | c285fd36daaadb10256e0549d797155ed90e2845 (tree) |
---|---|
Tiempo | 2020-06-20 00:16:24 |
Autor | The Grand Dog <alex.h@me.c...> |
Commiter | The Grand Dog |
nope this fixed it!
@@ -8,6 +8,7 @@ using System.Threading.Tasks; | ||
8 | 8 | |
9 | 9 | using Hjg.Pngcs; |
10 | 10 | using Hjg.Pngcs.Chunks; |
11 | +using Vintagestory.API.Common; | |
11 | 12 | |
12 | 13 | namespace Automap |
13 | 14 | { |
@@ -26,7 +27,7 @@ namespace Automap | ||
26 | 27 | |
27 | 28 | public Snapshotter(string path, ColumnsMetadata cols, int chunkSize, int worldSeed) |
28 | 29 | { |
29 | - this.fileName = Path.Combine(path, $"snapshot_{worldSeed}_{DateTime.UtcNow:u}.png"); | |
30 | + this.fileName = Path.Combine(path, $"snapshot_{worldSeed}.png"); | |
30 | 31 | this.chunkPath = Path.Combine(path, AutomapSystem._chunkPath); |
31 | 32 | this.cols = cols; |
32 | 33 | this.chunkSize = chunkSize; |
@@ -35,19 +36,13 @@ namespace Automap | ||
35 | 36 | /// <summary> |
36 | 37 | /// takes a snapshot. this should be called from an extra thread. |
37 | 38 | /// </summary> |
38 | - /// <param name="path">path to the map dir</param> | |
39 | - /// <param name="chunkPath">name of the chunks dir part thing</param> | |
40 | - /// <param name="cols"></param> | |
41 | - /// <param name="chunkSize"></param> | |
42 | 39 | public async void Take() |
43 | 40 | { |
44 | - var t = new Stopwatch(); | |
45 | - t.Start(); | |
46 | - | |
47 | - Console.WriteLine("snapshot started"); | |
48 | 41 | |
49 | 42 | ImageInfo info = new ImageInfo(Width * chunkSize, Height * chunkSize, 8, false); |
43 | + | |
50 | 44 | PngWriter snapWriter = FileHelper.CreatePngWriter(fileName, info, true); |
45 | + | |
51 | 46 | PngMetadata meta = snapWriter.GetMetadata( ); |
52 | 47 | meta.SetTimeNow( ); |
53 | 48 | var transparencyChunk = meta.CreateTRNSChunk( ); |
@@ -115,7 +110,6 @@ namespace Automap | ||
115 | 110 | { |
116 | 111 | Console.WriteLine("Snapshot exception!"); |
117 | 112 | } |
118 | - Console.WriteLine($"snapshot finished in {t.ElapsedMilliseconds}"); | |
119 | 113 | } |
120 | 114 | |
121 | 115 | private async Task<Dictionary<int, byte[][]>> ReadAllInGroup(IGrouping<int, ColumnMeta> group) |