• R/O
  • HTTP
  • SSH
  • HTTPS

提交

标签
No Tags

Frequently used words (click to add to your profile)

javaandroidc++linuxc#windowsobjective-ccocoaqt誰得pythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

Automap (client) [VS plugin mod]


Commit MetaInfo

修订版6660ebbcfa3cfd883788f3fd6a03e4c3a93e4702 (tree)
时间2020-04-29 03:43:43
作者melchior <melchior@user...>
Commitermelchior

Log Message

Fixed missing ref on ChunkMeta, Using Generics

更改概述

差异

--- a/Automap/Subsystems/AutomapSystem.cs
+++ b/Automap/Subsystems/AutomapSystem.cs
@@ -207,7 +207,7 @@ namespace Automap
207207
208208 ProcessChunkBlocks(mostActiveCol.Key, mapChunk, ref chunkMeta);
209209
210- PngWriter pngWriter = SetupPngImage(mostActiveCol.Key, chunkMeta);
210+ PngWriter pngWriter = SetupPngImage(mostActiveCol.Key, ref chunkMeta);
211211 ChunkRenderer.GenerateChunkPngShard(mostActiveCol.Key, mapChunk, chunkMeta, pngWriter, out updatedPixels);
212212
213213 if (updatedPixels > 0)
--- a/Automap/Subsystems/JsonGenerator.cs
+++ b/Automap/Subsystems/JsonGenerator.cs
@@ -1,5 +1,6 @@
11 using System;
22 using System.Collections.Generic;
3+using System.Globalization;
34 using System.IO;
45 using System.Linq;
56 using System.Reflection;
@@ -79,12 +80,11 @@ namespace Automap
7980
8081 jsonWriter.WriteKeyValue("chunkSize", chunkSize);
8182
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 });
8888
8989 jsonWriter.WriteArray("chunkMetadataNames", ColumnMeta_Names);
9090
@@ -236,23 +236,25 @@ namespace Automap
236236
237237 public static class JsonWriterExtentions
238238 {
239+
239240 /// <summary>
240241 /// Writes an array in the form of key: [...ar] by calling .ToString() on all elements in ar.
241242 /// </summary>
242243 /// <param name="writer"></param>
243244 /// <param name="key"></param>
244245 /// <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)
246247 {
247248 writer.WritePropertyName(key);
248249 writer.WriteStartArray();
249250 foreach (var el in ar)
250251 {
251- writer.WriteValue(el.ToString());
252+ writer.WriteValue(el);
252253 }
253254 writer.WriteEndArray();
254255 }
255256
257+
256258 /// <summary>
257259 /// Like WriteArray(string, object[]) but for JArrays.
258260 /// </summary>