OSDN Git Service

W.I.P. Experimental use of Heightmap to replace Region map data
[automap/automap.git] / Automap / Subsystems / AutomapSystem.cs
index 4013b9a..e83bc1a 100644 (file)
@@ -132,9 +132,14 @@ namespace Automap
 
                private void ChunkAChanging(Vec3i chunkCoord, IWorldChunk chunk, EnumChunkDirtyReason reason)
                {
-                       Vec2i topPosition = new Vec2i(chunkCoord.X, chunkCoord.Z);
-
-                       columnCounter.AddOrUpdate(topPosition, 1, (key, colAct) => colAct + 1);
+               Vec2i topPosition = new Vec2i(chunkCoord.X, chunkCoord.Z);
+
+               //TODO: Track Y Chunk - Column, surface chunks being more important
+               //Only NEW/LOADED chunks unless edits > N 
+               //if (reason == EnumChunkDirtyReason.NewlyCreated || reason == EnumChunkDirtyReason.NewlyLoaded)
+               //{
+               columnCounter.AddOrUpdate(topPosition, 1, (key, colAct) => colAct + 1);
+               //}
                }
 
                private void AwakenCartographer(float delayed)
@@ -221,7 +226,7 @@ namespace Automap
                                                ProcessChunkBlocks(mostActiveCol.Key, mapChunk, ref chunkMeta);
 
                                                ChunkRenderer.SetupPngImage(mostActiveCol.Key, path, _chunkPath, ref chunkMeta);
-                                               ChunkRenderer.GenerateChunkPngShard(mostActiveCol.Key, mapChunk, chunkMeta, out updatedPixels);
+                                               ChunkRenderer.GenerateChunkPngShard(mostActiveCol.Key, mapChunk, chunkMeta, ref chunkTopMetadata, out updatedPixels);
 
                                                if (updatedPixels > 0)
                                                {