• R/O
  • HTTP
  • SSH
  • HTTPS

automap: Commit

Automap (OSS) GIT software repository


Commit MetaInfo

Révisionc285fd36daaadb10256e0549d797155ed90e2845 (tree)
l'heure2020-06-20 00:16:24
AuteurThe Grand Dog <alex.h@me.c...>
CommiterThe Grand Dog

Message de Log

nope this fixed it!

Change Summary

Modification

--- a/Automap/Subsystems/Snapshot.cs
+++ b/Automap/Subsystems/Snapshot.cs
@@ -8,6 +8,7 @@ using System.Threading.Tasks;
88
99 using Hjg.Pngcs;
1010 using Hjg.Pngcs.Chunks;
11+using Vintagestory.API.Common;
1112
1213 namespace Automap
1314 {
@@ -26,7 +27,7 @@ namespace Automap
2627
2728 public Snapshotter(string path, ColumnsMetadata cols, int chunkSize, int worldSeed)
2829 {
29- this.fileName = Path.Combine(path, $"snapshot_{worldSeed}_{DateTime.UtcNow:u}.png");
30+ this.fileName = Path.Combine(path, $"snapshot_{worldSeed}.png");
3031 this.chunkPath = Path.Combine(path, AutomapSystem._chunkPath);
3132 this.cols = cols;
3233 this.chunkSize = chunkSize;
@@ -35,19 +36,13 @@ namespace Automap
3536 /// <summary>
3637 /// takes a snapshot. this should be called from an extra thread.
3738 /// </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>
4239 public async void Take()
4340 {
44- var t = new Stopwatch();
45- t.Start();
46-
47- Console.WriteLine("snapshot started");
4841
4942 ImageInfo info = new ImageInfo(Width * chunkSize, Height * chunkSize, 8, false);
43+
5044 PngWriter snapWriter = FileHelper.CreatePngWriter(fileName, info, true);
45+
5146 PngMetadata meta = snapWriter.GetMetadata( );
5247 meta.SetTimeNow( );
5348 var transparencyChunk = meta.CreateTRNSChunk( );
@@ -115,7 +110,6 @@ namespace Automap
115110 {
116111 Console.WriteLine("Snapshot exception!");
117112 }
118- Console.WriteLine($"snapshot finished in {t.ElapsedMilliseconds}");
119113 }
120114
121115 private async Task<Dictionary<int, byte[][]>> ReadAllInGroup(IGrouping<int, ColumnMeta> group)
Afficher sur ancien navigateur de dépôt.