Automap (client) [VS plugin mod]
Revision | 6660ebbcfa3cfd883788f3fd6a03e4c3a93e4702 (tree) |
---|---|
Time | 2020-04-29 03:43:43 |
Author | melchior <melchior@user...> |
Commiter | melchior |
Fixed missing ref on ChunkMeta, Using Generics
@@ -207,7 +207,7 @@ namespace Automap | ||
207 | 207 | |
208 | 208 | ProcessChunkBlocks(mostActiveCol.Key, mapChunk, ref chunkMeta); |
209 | 209 | |
210 | - PngWriter pngWriter = SetupPngImage(mostActiveCol.Key, chunkMeta); | |
210 | + PngWriter pngWriter = SetupPngImage(mostActiveCol.Key, ref chunkMeta); | |
211 | 211 | ChunkRenderer.GenerateChunkPngShard(mostActiveCol.Key, mapChunk, chunkMeta, pngWriter, out updatedPixels); |
212 | 212 | |
213 | 213 | if (updatedPixels > 0) |
@@ -1,5 +1,6 @@ | ||
1 | 1 | using System; |
2 | 2 | using System.Collections.Generic; |
3 | +using System.Globalization; | |
3 | 4 | using System.IO; |
4 | 5 | using System.Linq; |
5 | 6 | using System.Reflection; |
@@ -79,12 +80,11 @@ namespace Automap | ||
79 | 80 | |
80 | 81 | jsonWriter.WriteKeyValue("chunkSize", chunkSize); |
81 | 82 | |
82 | - // fix later | |
83 | - //jsonWriter.WriteArray("edges", new int[4] { | |
84 | - //chunkTopMetadata.North_mostChunk, | |
85 | - //chunkTopMetadata.East_mostChunk, | |
86 | - //chunkTopMetadata.South_mostChunk, | |
87 | - //chunkTopMetadata.West_mostChunk } ); | |
83 | + jsonWriter.WriteArray("edges", new int[]{ | |
84 | + chunkTopMetadata.North_mostChunk, | |
85 | + chunkTopMetadata.East_mostChunk, | |
86 | + chunkTopMetadata.South_mostChunk, | |
87 | + chunkTopMetadata.West_mostChunk }); | |
88 | 88 | |
89 | 89 | jsonWriter.WriteArray("chunkMetadataNames", ColumnMeta_Names); |
90 | 90 |
@@ -236,23 +236,25 @@ namespace Automap | ||
236 | 236 | |
237 | 237 | public static class JsonWriterExtentions |
238 | 238 | { |
239 | + | |
239 | 240 | /// <summary> |
240 | 241 | /// Writes an array in the form of key: [...ar] by calling .ToString() on all elements in ar. |
241 | 242 | /// </summary> |
242 | 243 | /// <param name="writer"></param> |
243 | 244 | /// <param name="key"></param> |
244 | 245 | /// <param name="ar"></param> |
245 | - public static void WriteArray(this JsonTextWriter writer, string key, object[] ar) | |
246 | + public static void WriteArray<T>(this JsonTextWriter writer, string key, T[] ar) | |
246 | 247 | { |
247 | 248 | writer.WritePropertyName(key); |
248 | 249 | writer.WriteStartArray(); |
249 | 250 | foreach (var el in ar) |
250 | 251 | { |
251 | - writer.WriteValue(el.ToString()); | |
252 | + writer.WriteValue(el); | |
252 | 253 | } |
253 | 254 | writer.WriteEndArray(); |
254 | 255 | } |
255 | 256 | |
257 | + | |
256 | 258 | /// <summary> |
257 | 259 | /// Like WriteArray(string, object[]) but for JArrays. |
258 | 260 | /// </summary> |