OSDN Git Service

W.I.P. #7 fix for PNG Chunk factory, GUI stuff
authormelchior <melchior@users.osdn.me>
Fri, 17 Jan 2020 21:29:37 +0000 (16:29 -0500)
committermelchior <melchior@users.osdn.me>
Fri, 17 Jan 2020 21:29:37 +0000 (16:29 -0500)
Automap/Helpers.cs
Automap/Subsystems/AutomapSystem.cs

index be91d46..0c60dba 100644 (file)
@@ -3,6 +3,8 @@ using System.Collections.Generic;
 using System.Drawing;
 using System.Linq;
 
+using Hjg.Pngcs.Chunks;
+
 using Vintagestory.API.Client;
 using Vintagestory.API.Common;
 using Vintagestory.API.MathTools;
@@ -11,6 +13,11 @@ namespace Automap
 {
        public static class Helpers
        {
+               static Helpers( )
+               {
+                       //Called once - thus it can only be in a static constructor.
+                       PngChunk.FactoryRegister(PngMetadataChunk.ID, typeof(PngMetadataChunk));
+               }
                
                /// <summary>
                /// Hue, Saturation Value colorspace
index f28a85c..ece2be3 100644 (file)
@@ -457,7 +457,7 @@ namespace Automap
                Logger.VerboseDebug("{0} Existing world chunk shards", files.Length);
                #endif
 
-               PngChunk.FactoryRegister(PngMetadataChunk.ID, typeof(PngMetadataChunk));
+               
 
                foreach (var shardFile in files) {
                var result = chunkShardRegex.Match(shardFile.Name);